Search code examples
javascriptgoogle-closure-compiler

Closure compiler trips up on "final" keyword


I am using close to compile JavaScript using Google' closure compiler. The bundle I am compiling uses a lot of packages imported by NPM, and one of the downstream dependencies uses the final keyword. This is apparently a reserved keyword in ES3, and as a result closure throws an error.

What is the way around this? I don't want to change all the dependencies to not use final. Im a using Babel in the transpilation pipeline, if that makes a difference.


Solution

  • Use the --language_in flag to specify an input language of ECMASCRIPT5 or higher.