View Issue Details

IDProjectCategoryView StatusLast Update
0037114pas2jstranspilerpublic2020-06-07 20:51
ReporterPavol S Assigned ToMattias Gaertner  
PrioritynormalSeverityminorReproducibilityalways
Status assignedResolutionopen 
Summary0037114: Make google Closure Compiler compatible
DescriptionAfter using closure compiler (javascript -> javascript) there is no more rtl.run() to run our code.

To fix this we need to add to final code this line (before end):
window['rtl'] = rtl;
//# sourceMappingURL=hello.js.map

and add externs.js file:

/** @interface */
function ControlsAndConstants() {}
/** @type {number} */
ControlsAndConstants.prototype.run;

After this we can compile and run our JS with:
java -jar closure-compiler.jar --compilation_level SIMPLE --js hello.js --js_output_file hello-compiled.js --externs externs.js

But ADVANCED_OPTIMIZATIONS don't work.
java -jar closure-compiler.jar --compilation_level ADVANCED_OPTIMIZATIONS --js hello.js --js_output_file hello-compiled.js --externs externs.js
Tagsclosurecompiler, optimization
Fixed in Revision
Attached Files

Activities

Pavol S

2020-05-19 15:50

reporter   ~0122934

info about code generation required for ADVANCED_OPTIMIZATIONS:

https://developers.google.com/closure/compiler/docs/api-tutorial3

Mattias Gaertner

2020-06-07 20:51

manager   ~0123314

I can add a flag to generate the line "window['rtl']=rtl".

About ADVANCED_OPTIMIZATIONS:
pas2js uses a["somename"] all over the place. So I don't see how to support that.

Issue History

Date Modified Username Field Change
2020-05-19 15:43 Pavol S New Issue
2020-05-19 15:44 Pavol S Tag Attached: optimization
2020-05-19 15:44 Pavol S Tag Attached: closurecompiler
2020-05-19 15:50 Pavol S Note Added: 0122934
2020-06-07 20:51 Mattias Gaertner Note Added: 0123314
2020-06-07 20:51 Mattias Gaertner Assigned To => Mattias Gaertner
2020-06-07 20:51 Mattias Gaertner Status new => assigned