Re: Confusion about different [[Scope]] between Function Declaration and Function Expression

2012-12-13 Thread Allen Wirfs-Brock
ECMAScript 5.1 does not syntactically permit a FunctionDeclaration to directly appear nested within a Block. The semantics provided by the specification are those for a function declaration at the top level of a function. The only standard way to evaluate a function declaration within a

Re: Confusion about different [[Scope]] between Function Declaration and Function Expression

2012-12-13 Thread Brendan Eich
Allen Wirfs-Brock wrote: Some implementations bind the function name scoped to the block others bind the name scoped to the enclosing function. Detailed aside: no standard implementation actually binds to a block scope (yet -- this is proposed for ES6 and implementations are appearing,

Confusion about different [[Scope]] between Function Declaration and Function Expression

2012-12-12 Thread Kang-Hao (Kenny) Lu
(Resending on behalf of 张立理 otakus...@live.com because his mail didn't go through.) According to [section 13 Function Definition](http://ecma-international.org/ecma-262/5.1/#sec-13) of ECMAScript-262 5.1, the **Function Declaration** production and the **Function Expression** production are