Comment #1 on issue 686 by [email protected]: "With" and function scope
http://code.google.com/p/v8/issues/detail?id=686

Fedor, this does not look like a bug to me.

According to section 13 of ECMA-262 standard there is a subtle difference between FunctionDeclaration and FunctionExpression. FunctionDeclaration sets [[Scope]] of the new Function to the VariableEnvironment of the running ExecutionContext while FunctionExression sets [[Scope]] to the
LexicalEnvironment of the running ExecutionContext.

WithStatement [section 12.10] changes LexicalEnvironment of the running ExecutionContext. Thus WithStatement cannot affect scope of a function created with a FunctionDeclaration.

Behaviour of V8 matches behaviour of JavaScript engines of Opera and Safari. SpiderMonkey behaves
differently but it's behaviour contradicts ECMA-262 from my point of view.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to