google / closure-compiler

A JavaScript checker and optimizer.
https://developers.google.com/closure/compiler/
Apache License 2.0
7.36k stars 1.14k forks source link

Can not create const Database #2230

Open eltiodelsofa opened 7 years ago

eltiodelsofa commented 7 years ago

create test.js file with only

const Database = null;

$ java -jar compiler.jar --js test.js

test.js:1: ERROR - Duplicate let / const / class declaration in the same scope is not allowed. const Database = null;

$ java -jar compiler.jar --version Closure Compiler (http://github.com/google/closure-compiler) Version: v20161201 Built on: 2016-12-02 14:56

Same with online version

Dominator008 commented 7 years ago

Unfortunately, the definition conflicts with one of the externs: https://github.com/google/closure-compiler/blob/e27ba79b60c63adf5e2f8d37e75ceeb82f84d425/externs/browser/html5.js#L675

We should probably rename that or just drop it since Web SQL is deprecated.