the code:
function test4() { var x = 10; var y = 100; // inner referred x only function inner () { console.log(x); debugger; } // inner2 referred y to make sure y is in the scope of inner function inner2 () { console.log(y); } return inner; } var foo = test4(); foo();
y is in the inner region, and even only inner2 , which has never been used, refers to it. I checked the result in scope and x , y :

But when I checked the variables in the clock panel and console, I canβt get all of them:

It is strange that y is in the area, but not detected when using the debugger. So, does this mean that the debugger cannot access a variable that is not used in the current context even in closing, or is it just an error? (My chrome version is 51.0.2704.103 m)
It looks like Why does the Chrome debugger consider the private local variable undefined? but not the same. Because inner2 in my code make sure y is in closure. And actually my question is the opposite of Louis to answer on that.
javascript google-chrome
ST_Lighter
source share