【发布时间】:2015-11-09 15:52:43
【问题描述】:
为什么这段代码没问题:
var test = {
fn1: function(_origin, _componentType) {
if(arguments.length > 1) throw "xx";
// this strict is ok
"use strict";
var interface = new Object(this);
}
}
虽然不是
var test = {
fn1: function(_origin, _componentType) {
// This strict throws SyntaxError
"use strict";
if(arguments.length > 1) throw "xx";
var interface = new Object(this);
}
}
我知道 interface 是严格模式下的保留字,但两个例子不应该抛出错误吗?
【问题讨论】: