With this code:
function baz() { var x = \"foo\"; function bar() { debugger; }; bar(); } baz();
I get this unexpected result:<
Like @Louis said it caused by v8 optimizations. You can traverse Call stack to frame where this variable is visible:
Or replace debugger with
debugger
eval('debugger');
eval will deopt current chunk
eval