Brendan Eich (2015-02-02T17:46:30.000Z)
d at domenic.me (2015-02-13T23:52:14.490Z)
I took Felix's question to be about grammar naming and factoring conventions, not about `var` per se. Since ES1 (ECMA-262 Edition 1, E262.pdf on the ecma-international.org site), the grammar called the nonterminal producing `var` declarations _VariableStatement_ (ES1 2.2). That was simply for consonance with the other productions reached directly from the Statement nonterminal. It was just a nominal choice, nothing was intended to contradict that `var` was a declaring form. From the start, _VariableStatement_ produced right-hand sides with _Declaration_-based names: ``` VariableStatement : var VariableDeclarationList ; ``` to clue readers in just a bit. Arguably _VariableStatement_ was the better name from "above" in the grammar-structure sense, since it acts like a statement and may occur unbraced even as a sub-statement (e.g. consequent of an if (condition)). (An even better name from the C family of languages than _VariableDeclarationList_ would be _VariableDeclaratorList_. The `var` introduces a list of declarators; the whole is a declaration (which may bind many names, either at top level or via destructuring). An ancient nit I failed to pick in ES1 days.) ES5 didn't change things much, but ES6 did indeed add _Declaration_ as a new non-terminal produced from _StatementListItem_. IINM, Felix is asking why when this was done, _VariableStatement_ was not moved to the new _Declaration_ sub-grammar. Allen might want to comment.