Ian Halliday (2013-11-13T23:41:56.000Z)
domenic at domenicdenicola.com (2013-11-17T18:15:04.911Z)
Wait, so is there no variable shadowing allowed then? > ### [13.1.1 Static Semantics: Early Errors](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-block-static-semantics-early-errors) > > Block : { StatementList } > > * It is a Syntax Error if the LexicallyDeclaredNames of StatementList contains any duplicate entries. > > * It is a Syntax Error if any element of the LexicallyDeclaredNames of StatementList also occurs in the VarDeclaredNames of StatementList. StatementList can contain Blocks whose LexicallyDeclaredNames and VarDeclaredNames algorithms return the values for their StatementLists, so it recursively collects the names from all nested lexical and var declarations. It looks like VarDeclaredNames is missing a definition for VariableStatement because I can't see any way for the bound names of a VariableStatement to get added to VarDeclaredNames lists. But barring for the moment that I cannot find an algorithm definition that adds BoundNames of a VariableStatement to VarDeclaredNames, this second early error bullet implies that shadowing of bound names is not allowed at all. Is this correct?