View Issue Details

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

To fix this we need to add to final code this line (before end):
window['rtl'] = rtl;

and add externs.js file:

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

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

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


Pavol S

2020-05-19 15:50

reporter   ~0122934

info about code generation required for ADVANCED_OPTIMIZATIONS:

Mattias Gaertner

2020-06-07 20:51

developer   ~0123314

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

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