Description
By code inspection I found that loadWithNewGlobal uses wrong global instance (new global created rather than caller's global) to wrap input arguments.
Test:
loadWithNewGlobal({
name: "test",
script: "arguments[0]();"
}, func);
function func() {
try {
foo;
} catch (e) {
if (! (e instanceof ReferenceError)) {
print("FAILED: expected ReferenceError!");
}
}
}
Should not print "FAILED..."
Test:
loadWithNewGlobal({
name: "test",
script: "arguments[0]();"
}, func);
function func() {
try {
foo;
} catch (e) {
if (! (e instanceof ReferenceError)) {
print("FAILED: expected ReferenceError!");
}
}
}
Should not print "FAILED..."