daurnimator edited this page May 25, 2017 · 8 revisions

Status of ES6 support in Closure Compiler


ECMAScript 6 is now officially supported as an input language for the Closure Compiler. You cannot use it as an output language yet; for now you need to transpile down to ES5 or ES3. If you find that the Closure Compiler does not support your favorite ES6 feature, you can file an issue, but please be aware that supporting the entire ES6 specification is a non-goal for the Closure Compiler. We currently avoid features that cannot be transpiled cleanly to ES5, and features that tend to lead to code which is difficult to analyze and typecheck.

This is a place to collect changes that will need to be made to the compiler.






The new parser is in place, and has replaced the old Rhino parser. It understands all ES6 features though there may still be a few bugs here and there.


We support transpilation of the following ES6 features down to ES5/3.

  • let/const
  • arrow functions
  • default parameters and rest ("...") parameters in functions
  • The spread ("...") operator in function calls and array literals
  • Classes (ES6 classes will be @struct by default. You can add @unrestricted to override that behavior. See the 'JSDoc Tag Reference'
  • Computed properties and short properties in object literals.
  • Method declarations in object literals
  • "for of" loops
  • generator functions
  • template strings
  • Better unicode escapes in string literals (e.g. "\u{1F436}" == "🐶")
  • destructuring assignment
  • modules

Type Checking

Type checking is currently done on "transpiled" code. Direct support will happen after the new type inference is stable.


Optimization currently occur on "transpiled" code. Direct support will happen after the "check" phase understands ES6.

Code Printer

The code printer should at this point support all of ES6

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.