Status: New
Owner: ----
New issue 3339 by [email protected]: Incomplete lexical environment
in debugger
http://code.google.com/p/v8/issues/detail?id=3339
This issue was observed in v8 3.24.35.33
I have inferred that v8 performs an optimization pass to remove unused
variables from the lexical environment of a function.
Consider the following code:
function foo(bar) {
$('#foo').click(function() {
console.log('clicked!'); // Place breakpoint here.
});
}
foo('hello v8 devs');
The variable `bar` is not referenced within the anonymous function,
and is optimized away. I was surprised that when I entered the
debugger via a breakpoint on the third line that `bar` evaluated to
undefined!
Refering to `bar` in the source code works as expected:
function foo(bar) {
$('#foo').click(function() {
console.log(bar); // Place breakpoint here.
});
}
Shouldn't the full lexical environment be available when debugging?
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.