Why is this code fine:
var test = {
fn1: function(_origin, _componentType) {
if(arguments.length > 1) throw "xx";
// this strict is ok
"use strict";
var interface = new Object(this);
}
}
While this isn't
var test = {
fn1: function(_origin, _componentType) {
// This strict throws SyntaxError
"use strict";
if(arguments.length > 1) throw "xx";
var interface = new Object(this);
}
}
I know interface is reserved word in strict mode, but shouldn't both examples throw an error?