When running the following script in Safari (with the Inspector open)
window.onload = function() {
"use strict";
var x = 1;
debugger; // debugger will auto-break on this line
}
I get the following error when asking for x
in the console while being on that breakpoint:
Error
message: "'with' statements are not valid in strict mode"
Removing the "use strict";
line lets me access x
from the console while on that breakpoint.
Both times the x
is shown under Scope Variables
in the sidebar.