When I enable Closure Compiler and set GWT JavaScript compiler output style to DETAILED mode
by providing the following configuration of gwt-maven-plugin:
<configuration>
<modules>
<module>org.eclipse.che.ide.IDE</module>
</modules>
<style>DETAILED</style>
<enableClosureCompiler>true</enableClosureCompiler>
</configuration>
I get the following compilation error:
[INFO] Compiling 4 permutations
[INFO] Compiling permutation 0...
[ERROR] error optimizing:JSC_VAR_ARGUMENTS_SHADOWED_ERROR. Shadowing "arguments" is not allowed at org/eclipse/che/plugin/maven/client/command/MavenCommandModel.java line 25 : 0
[INFO] [ERROR] Unexpected internal compiler error
[INFO] java.lang.RuntimeException: Shadowing "arguments" is not allowed
[INFO] at com.google.gwt.dev.js.ClosureJsRunner.compile(ClosureJsRunner.java:207)
[INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.generateJavaScriptCode(JavaToJavaScriptCompiler.java:524)
[INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.compilePermutation(JavaToJavaScriptCompiler.java:347)
[INFO] at com.google.gwt.dev.jjs.MonolithicJavaToJavaScriptCompiler.compilePermutation(MonolithicJavaToJavaScriptCompiler.java:296)
[INFO] at com.google.gwt.dev.jjs.UnifiedAst.compilePermutation(UnifiedAst.java:143)
[INFO] at com.google.gwt.dev.CompilePerms.compile(CompilePerms.java:197)
[INFO] at com.google.gwt.dev.ThreadedPermutationWorkerFactory$ThreadedPermutationWorker.compile(ThreadedPermutationWorkerFactory.java:50)
[INFO] at com.google.gwt.dev.PermutationWorkerFactory$Manager$WorkerThread.run(PermutationWorkerFactory.java:74)
[INFO] at java.lang.Thread.run(Thread.java:745)
[INFO] [ERROR] Unrecoverable exception, shutting down
[INFO] com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries)
[INFO] at com.google.gwt.dev.javac.CompilationProblemReporter.logAndTranslateException(CompilationProblemReporter.java:112)
[INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.compilePermutation(JavaToJavaScriptCompiler.java:363)
[INFO] at com.google.gwt.dev.jjs.MonolithicJavaToJavaScriptCompiler.compilePermutation(MonolithicJavaToJavaScriptCompiler.java:296)
[INFO] at com.google.gwt.dev.jjs.UnifiedAst.compilePermutation(UnifiedAst.java:143)
[INFO] at com.google.gwt.dev.CompilePerms.compile(CompilePerms.java:197)
[INFO] at com.google.gwt.dev.ThreadedPermutationWorkerFactory$ThreadedPermutationWorker.compile(ThreadedPermutationWorkerFactory.java:50)
[INFO] at com.google.gwt.dev.PermutationWorkerFactory$Manager$WorkerThread.run(PermutationWorkerFactory.java:74)
[INFO] at java.lang.Thread.run(Thread.java:745)
[INFO] [ERROR] Not all permutation were compiled , completed (0/4)
It means that using 'arguments' as a name of a method parameter is forbidden by Google Closure Compiler because, it seems, that it's reserved for internal using here:
https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/SyntacticScopeCreator.java#L38
Client command framework improvements
1. Introduced contextual commands.
2. Added ${explorer.current.file.parent.path} macro.
3. Cleaned up unused resources.
4. Refactored code in order to simplify it and made it more clear and understandable:
- simplified a way of providing new command types;
- command types api moved to ide-api to avoid unnecessary dependency on machine extension;
- command management extracted from EditCommandsPresenter to the separate facade - CommandManager. So EditCommandsPresenter now doesn't perform several http requests manipulating with commands but only one;
- refactored code related to the obsolete terminology CommandPropertyValueProvider -> Macro;
- macro can provide its description (it will be really useful for showing it in UI);
- macros processing separated from the command execution and extracted to the separate component MacroProcessor since it's used not only for the commands but in debug configurations for example.
* Export proxy object instead of real maven terminal object. Avoid NPE in case jar lab's are not set for javac project
Signed-off-by: Vitaly Parfonov <vparfonov@codenvy.com>