Allen Wirfs-Brock (2013-11-14T00:27:28.000Z)
domenic at domenicdenicola.com (2013-11-17T18:17:38.656Z)
On Nov 13, 2013, at 4:13 PM, Ian Halliday wrote: > Then for 13.1.8 shouldn’t there be something like this > > ``` > StatementListItem : Statement > 1. If Statement is a Block then return a new empty List. > 2. Else return VarDeclaredNames of Statement > ``` > > defined in order to prevent the var names from spreading into enclosing blocks? > > I might be misunderstanding VarDeclaredNames. I am guessing that it should be a collection of all the names declared via var declaration statements, i.e.VariableStatement, but there isn’t a definition of VarDeclaredNames for VariableStatement. VarDeclaredNames are hoisted to the top level (function or script) and it is illegal to hoist a VarDeclaredName past a lexical declaration for the same named. "It is a Syntax Error if any element of the LexicallyDeclaredNames of StatementList also occurs in the VarDeclaredNames ofStatementList." is saying that if any name that has is immediately declared within this block cannot also occur in a var declaration either immediately in this block or in many nested block (to any level of nesting). The hoisting is handled in the definitions of LexicallyDeclaredNames