dojo / util

Dojo 1 - build utilities. Please submit bugs to https://bugs.dojotoolkit.org/
https://dojotoolkit.org/
Other
60 stars 105 forks source link

Closure Compiler Error with ES6 code and Dojo 1.16.0? #79

Open dylans opened 4 years ago

dylans commented 4 years ago

https://discourse.dojo.io/t/closure-compiler-strict-errors/456

As reported by yassam:

I’m using Dojo 1.16.0.

The Dojo build system is giving me INTERNAL COMPILER ERROR on my ES6 code. I figure this might be due to a buggy version of the Closure compiler shipped with Dojo, so I downloaded the latest version of the Closure compiler and I now get a bunch of errors in the dojo code itself.

It complains about dojo code not compiling in strict mode, even though I haven’t set strict mode.

Specifically, here’s the relevant part of my build profile:

layerOptimize: 'closure', optimize: 'closure',

optimizeOptions: { languageIn: 'ECMASCRIPT6', languageOut: 'ECMASCRIPT5' },

Note that the input language is ECMASCRIPT6 not ECMASCRIPT6_STRICT

Is there an easy way to get the latest version of the closure compiler to work?

boualikamel commented 4 years ago

Have the same problem

msssk commented 4 years ago

Can you provide a (preferably minimal) test case for this? Dojo 1.16 includes a version of the Closure compiler that is a few years old, but it does have some ES6 support. I am able to build a simple app with a few ES6 features (const, spread operator, object shorthand) without issue, but adding arrow functions results in the INTERNAL COMPILER ERROR. Downloading Closure compiler v20191111 and replacing util/closureCompiler/compiler.jar with it I am able to successfully compile code with arrow functions as well. The warning messages for Dojo code have changed, but I am not seeing any errors.

sindilevich commented 4 years ago

@dylans, is the original reporter still can check whether the changes introduced in https://github.com/dojo/util/pull/80 solve the issue?

dylans commented 4 years ago

@dylans, is the original reporter still can check whether the changes introduced in #80 solve the issue?

I've reached out and asked them to verify. Thanks for reminding me!

dasa commented 2 years ago

Can this be closed?