-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
buildControl: set default values for Closure languageIn/languageOut #83
Conversation
The Google Closure Compiler has a default language output setting that may change by release. v20170806 changed the default output language to ECMASCRIPT5. This PR adds a default value of 'NO_TRANSPILE' if the build tool is configured to use the Google Closure Compiler.
bc.optimizeOptions = bc.optimizeOptions || {}; | ||
// ECMASCRIPT_2017 is necessary to avoid throwing errors on block-scoped functions | ||
// https://github.com/google/closure-compiler/issues/3189 | ||
bc.optimizeOptions.languageIn = bc.optimizeOptions.languageIn || 'ECMASCRIPT_2017'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be ECMASCRIPT_2019 to match the stable version here?
https://github.com/google/closure-compiler/blob/v20200112/src/com/google/javascript/jscomp/CompilerOptions.java#L3217
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another option would be to upgrade Closure to v20201006 and use ECMASCRIPT_2020: https://github.com/google/closure-compiler/wiki/Releases#october-6-2020-v20201006
) * buildControl: set default languageOut for Closure to 'NO_TRANSPILE' The Google Closure Compiler has a default language output setting that may change by release. v20170806 changed the default output language to ECMASCRIPT5. This PR adds a default value of 'NO_TRANSPILE' if the build tool is configured to use the Google Closure Compiler. * Set default languageIn/languageOut to ECMASCRIPT3 to maintain previous behavior * built tool: set default languageIn to ES2017 (cherry picked from commit 71f486a)
) * buildControl: set default languageOut for Closure to 'NO_TRANSPILE' The Google Closure Compiler has a default language output setting that may change by release. v20170806 changed the default output language to ECMASCRIPT5. This PR adds a default value of 'NO_TRANSPILE' if the build tool is configured to use the Google Closure Compiler. * Set default languageIn/languageOut to ECMASCRIPT3 to maintain previous behavior * built tool: set default languageIn to ES2017 (cherry picked from commit 71f486a)
) * buildControl: set default languageOut for Closure to 'NO_TRANSPILE' The Google Closure Compiler has a default language output setting that may change by release. v20170806 changed the default output language to ECMASCRIPT5. This PR adds a default value of 'NO_TRANSPILE' if the build tool is configured to use the Google Closure Compiler. * Set default languageIn/languageOut to ECMASCRIPT3 to maintain previous behavior * built tool: set default languageIn to ES2017 (cherry picked from commit 71f486a)
) * buildControl: set default languageOut for Closure to 'NO_TRANSPILE' The Google Closure Compiler has a default language output setting that may change by release. v20170806 changed the default output language to ECMASCRIPT5. This PR adds a default value of 'NO_TRANSPILE' if the build tool is configured to use the Google Closure Compiler. * Set default languageIn/languageOut to ECMASCRIPT3 to maintain previous behavior * built tool: set default languageIn to ES2017 (cherry picked from commit 71f486a)
) * buildControl: set default languageOut for Closure to 'NO_TRANSPILE' The Google Closure Compiler has a default language output setting that may change by release. v20170806 changed the default output language to ECMASCRIPT5. This PR adds a default value of 'NO_TRANSPILE' if the build tool is configured to use the Google Closure Compiler. * Set default languageIn/languageOut to ECMASCRIPT3 to maintain previous behavior * built tool: set default languageIn to ES2017 (cherry picked from commit 71f486a)
The Google Closure Compiler has a default language output setting that may change by release. v20170806 changed the default output language to ECMASCRIPT5.
This PR adds a default values for
languageIn
(ECMASCRIPT_2017) andlanguageOut
(ECMASCRIPT3) if the build tool is configured to use the Google Closure Compiler. These can be overridden inoptimizeOptions
in the build profile.ECMASCRIPT_2017 is used for
languageIn
to allow existing code to continue working. With the addition of block scope in ES6 the Google Closure Compiler treats block-scoped functions as errors in pre-ES6 code.Fixes #81