このコードが問題ない理由:
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);
}
}
インターフェイスが厳密モードでは予約語であることは知っていますが、両方の例でエラーがスローされるべきではありませんか?