[英]SyntaxError: 'with' statements are not valid in strict mode
I'm getting this error in safari console when I try to do anything from a breakpoint. 当我尝试从断点处做任何事情时,我在safari控制台中收到此错误。 Bug report here: https://bugs.webkit.org/show_bug.cgi?id=83267
Bug报告: https : //bugs.webkit.org/show_bug.cgi?id = 83267
Does anyone have a workaround? 有没有人有解决方法? For reasons that I am assuming are related to this javascript has ceased to run on my site in safari.
由于我假设的原因与此相关,javascript已停止在我的网站上运行safari。
edit: the bug report also contains repro steps. 编辑:错误报告还包含repro步骤。
another edit: I'm not using a "with" statement. 另一个编辑:我没有使用“with”语句。 This is a bug from the safari console.
这是safari控制台的一个错误。
The with(obj) {}
statement is deprecated, and as such, is not valid in strict mode. 不推荐使用
with(obj) {}
语句,因此在严格模式下无效。
To solve this, either disable strict mode, or stop using with statements! 要解决此问题,请禁用严格模式,或停止使用with语句!
Strict mode in ECMAScript 5 bans eg. ECMAScript 5中的严格模式禁止例如。
with
statement. with
声明。 You have two choices: 你有两个选择:
"strict mode";
line from the file / function), or "strict mode";
文件/函数中的行),或 with
statements - they are harmful and totally unreadable. with
语句-他们是有害的,完全不可读。 More on strict mode from John Resig: ECMAScript 5 Strict Mode, JSON, and More . 有关John Resig严格模式的更多信息: ECMAScript 5 Strict Mode,JSON等 。
You can read in the article, that strict mode: 你可以在文章中看到那种严格模式:
delete
variable (like in delete foo;
), delete
变量(如delete foo;
), eval
, eval
, caller
and callee
), caller
和callee
), with
statements, with
陈述,
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.