View Issue Details

IDProjectCategoryView StatusLast Update
0037114pas2jstranspilerpublic2020-12-29 03:57
ReporterPavol S Assigned ToMattias Gaertner  
Status resolvedResolutionfixed 
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

manager   ~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.

Mattias Gaertner

2020-12-29 03:57

manager   ~0127887

About appending some js lines:
There is now an option -Ja to append js code, so you can add the extra lines.

About Advanced optimizations:
With option -O2 pas2js will now create local vars, avoiding many pas[''] references.

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
2020-12-29 03:57 Mattias Gaertner Status assigned => resolved
2020-12-29 03:57 Mattias Gaertner Resolution open => fixed
2020-12-29 03:57 Mattias Gaertner Note Added: 0127887