Status: New
Owner: ----
Labels: Type-Bug Priority-Medium

New issue 875 by [email protected]: Closure problems with the Javascript "with" statement.
http://code.google.com/p/v8/issues/detail?id=875

From original report in the Chromium bug tracker:

http://code.google.com/p/chromium/issues/detail?id=42053


What steps will reproduce the problem?

1. Use the with () {...} statement.
2. Define a named (non-anonymous) function.
3. Try to use the identifiers defined by the with statement.

What is the expected result?

The identifiers should be first resolved relative to the object defined in the with
statement.

What happens instead?

Identifiers are resolved relative to the window.

Please provide any additional information below. Attach a screenshot if
possible.

The problem is the inconsistency of this behaviour. If the function inside the with block is anonymous, the closure works and identifiers are properly resolved. If, however, they are defined as named functions, the problem rears its ugly head.

Example of the problem in action: http://jsbin.com/iyopu/edit



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

Reply via email to