我想全局启用严格检查。
> use strict;
... // waits for more input
> "use strict";
'use strict' // but does not turn on sanity checks
我错过了什么吗?
答案 0 :(得分:0)
如果您正在运行Node> = 0.10.7,请运行node --use_strict
。
答案 1 :(得分:0)
你不能因为每一行都是它自己的功能。
你可以在这样的每一行前加上'use strict':
> 'use strict'; with({}){} // throws
或运行节点--use_strict
。