Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 388968

Summary: Build minification is broken
Product: [ECD] Orion Reporter: Mark Macdonald <mamacdon>
Component: RelengAssignee: Mark Macdonald <mamacdon>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ken_walker
Version: 1.0   
Target Milestone: 1.0 M2   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Mark Macdonald CLA 2012-09-06 12:12:14 EDT
Go to orion.eclipse.org

The Navigator and Editor pages are not minified.

The build log shows syntax errors from Rhino about trailing commas and reserved words used as identifiers:
http://download.eclipse.org/orion/drops/I201209052230/buildLog-I20120905-2230.txt
Comment 1 Mark Macdonald CLA 2012-09-06 16:40:19 EDT
Correction, there were no trailing commas. It was Rhino-unfriendly words in our code. These fall into 2 categories:

ES3 reserved words
> abstract boolean byte char class double extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile

ES5 reserved words
> class enum export extends import super implements interface let package private protected public static yield

Rhino (at least the version our build uses) won't allow any of these words.

For safety's sake, I've modified JSLint to produce errors on any Rhino-unfriendly word. Prior to this, its treatment was inconsistent -- for example it wouldn't warn about 'class' when running in ES5 mode, and almost all the ES3 words would slip by unnoticed (like 'char', which has broken us many times). Now you will see errors on all of these while you code.
Comment 3 Mark Macdonald CLA 2012-09-06 16:52:39 EDT
FWIW, I've posted a mass-linting script to GitHub [1]. If something bad sneaks into the build, run the lint script on the whole Orion client repo like this:

> node megalint.js C:\code\orion\org.eclipse.orion.client
> Lint c:/code/orion/org.eclipse.orion.client/bundles/org.eclipse.orion.client.core/web/orion/widgets/plugin/PluginEntry.js...
> PluginEntry.js:94:41:Expected an identifier and instead saw 'class' (a reserved word).

Grep the output for (reserved word|Extra comma) and you should see all the Rhino-busting errors.

[1] https://github.com/mamacdon/megalint
Comment 4 Ken Walker CLA 2012-09-06 17:10:15 EDT
Awesome, thanks Mark