Closed
Description
https://people.mozilla.org/~jorendorff/es6-draft.html#sec-scripts-static-semantics-early-errors
https://people.mozilla.org/~jorendorff/es6-draft.html#sec-block-static-semantics-early-errors
- It is a Syntax Error if any element of the LexicallyDeclaredNames of StatementList also occurs in the VarDeclaredNames of StatementList.
function do_something() {
let foo;
var foo; // it should be an error
}
Seems that it should be a TS compiler error, too.
p.s.: By the way, Visual Studio's JS editor properly highlights it as an error.