ie8: false,
}
input: {
- var window = {};
!function() {
function Foo() {
console.log(this instanceof Foo);
new window.Foo();
}
expect: {
- var window = {};
window.Foo = function o() {
console.log(this instanceof o);
};
ie8: true,
}
input: {
- var window = {};
!function() {
function Foo() {
console.log(this instanceof Foo);
new window.Foo();
}
expect: {
- var window = {};
window.Foo = function Foo() {
console.log(this instanceof Foo);
};
]).join("\n"));
function createContext() {
- var ctx = vm.createContext(Object.defineProperty({}, "console", { value: { log: log } }));
+ var ctx = vm.createContext(Object.defineProperties({}, {
+ console: { value: { log: log } },
+ global: { get: self },
+ self: { get: self },
+ window: { get: self },
+ }));
var global = setupContext.runInContext(ctx);
return ctx;
+ function self() {
+ return this;
+ }
+
function safe_log(arg, level) {
if (arg) switch (typeof arg) {
case "function":