在 Safari 中运行以下脚本时(检查器打开)
window.onload = function() {
"use strict";
var x = 1;
debugger; // debugger will auto-break on this line
}
x
在该断点上时在控制台中询问时出现以下错误:
Error
message: "'with' statements are not valid in strict mode"
删除该"use strict";
行可让我x
在该断点处从控制台访问。
两次x
都显示Scope Variables
在侧边栏中。