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

Bug 379826

Summary: Console page is not optimized
Product: [ECD] Orion Reporter: Mark Macdonald <mamacdon>
Component: ClientAssignee: Simon Kaegi <simon_kaegi>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: grant_gayed, simon_kaegi
Version: 0.5   
Target Milestone: 0.5 RC1   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Mark Macdonald CLA 2012-05-17 11:47:17 EDT
1. Go to http://orion.eclipse.org/console/built-consolePage.js
2. Note that the source code here is not minified.

The build log shows that the r.js optimizer failed:

> [java] Tracing dependencies for: console/consolePage
> [java] Minifying file: /opt/public/eclipse/e4/orion/I201205162230/optimization/./console/built-consolePage.js
> [java] May 16, 2012 10:39:47 PM com.google.javascript.jscomp.LoggerErrorManager println
> [java] SEVERE: /opt/public/eclipse/e4/orion/I201205162230/optimization/./console/built-consolePage.js:47085: ERROR - Parse error. invalid property id
> [java]       args.push({ arg: arg, char: arg.prefix[i], part: 'prefix' });
> [java]                                  ^

This is due to a Rhino "feature" -- its parser complains when you use certain reserved words ('char' is one) as identifiers or property names in an object literal. The failing lines are in gcli source code, so we either need to change the code or make Rhino more permissive.
Comment 1 Mark Macdonald CLA 2012-05-17 11:52:55 EDT
This 'FEATURE_RESERVED_KEYWORD_AS_IDENTIFIER' flag looks promising, but I'm not sure how to set it from the command line.

http://www.mail-archive.com/dev-tech-js-engine-rhino@lists.mozilla.org/msg01021.html
Comment 2 Mark Macdonald CLA 2012-05-23 12:00:12 EDT
Couldn't find a way to disable this behavior of Rhino from the command line, so I just fixed the code.

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=f286bc9d84c43a4f8125dacb722494ba688adc97
Comment 3 Mark Macdonald CLA 2012-05-28 10:28:18 EDT
There's still a problem here, see the build log from [1]:

> [java] Minifying file: /opt/public/eclipse/e4/orion/I201205272230/optimization/./console/built-consolePage.js
>      [java] Cannot closure compile file: /opt/public/eclipse/e4/orion/I201205272230/optimization/./console/built-consolePage.js. Skipping it.
>      [java] May 27, 2012 10:39:15 PM com.google.javascript.jscomp.LoggerErrorManager println
>      [java] SEVERE: /opt/public/eclipse/e4/orion/I201205272230/optimization/./console/built-consolePage.js:48457: ERROR - Parse error. missing name after . operator
>      [java]     markup.push({ status: status, string: argTrace.char });
>      [java]                                                         ^

[1] http://download.eclipse.org/orion/drops/I201205272230/buildLog-I20120527-2230.txt
Comment 4 Mark Macdonald CLA 2012-05-28 10:56:03 EDT
Will fix in RC1
Comment 5 Simon Kaegi CLA 2012-06-08 15:32:52 EDT
Fixed.