Support "simple" Closure compilation mode #312
Description
The Closure Compiler can almost consume the output of DDC with --language_in=ECMASCRIPT6_STRICT -O SIMPLE
(and output ES5 code).
Here are some blockers:
-
(fixed by google/closure-compiler@3f54e47)
super
getter calls aren't supported yet (Implement ES6 transpilation of super.getter calls google/closure-compiler#1089). -
(fixed)
super
method calls make the compiler to crash (Internal error with super method call google/closure-compiler#1125). -
super
method calls on computed properties crash the compiler (Super calls on computed properties crash the compiler google/closure-compiler#1184) -
Cannot (re)define local
Object
,Error
classes incore.js
. This can be worked around by attaching the classes to some namespace (see branch closure-qualify):core.Object = class Object { ... }; core.Deprecated = class Deprecated extends core.Object { ... };
-
(fixed)
let
often makes the compiler to crash (Internal error with let inside while loop google/closure-compiler#1124). Could be somehow worked around by using var everywhere, but then the hand-written parts of the runtime are an issue. -
(fixed by e693a00)
"The class in an extends clause must be a qualified name" (see workaround in branch closure-annotations-alias-parent). -
Cycles in ES6 module imports crash Closure. This can be worked around by using rollup.js to unfold the imports (fixed one blocker in 0.25.4), then running Closure on the result.
Other annoying non-blockers:
- (fixed)
Misplaced annotations warning with computed properties (Misplaced annotation warning with computed properties in ES6 classes google/closure-compiler#1126)
(Note: "ADVANCED" optimizations are filed under #311)