-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Closed
Closed
Copy link
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.v22.xIssues that can be reproduced on v22.x or PRs targeting the v22.x-staging branch.Issues that can be reproduced on v22.x or PRs targeting the v22.x-staging branch.vmIssues and PRs related to the vm subsystem.Issues and PRs related to the vm subsystem.
Description
Version
v22.5.0
Platform
Microsoft Windows NT 10.0.22631.0 x64
Subsystem
vm
What steps will reproduce the bug?
"use strict";
const vm = require("vm");
class EventTarget {
addEventListener() {}
}
const windowConstructor = function () {};
Object.setPrototypeOf(windowConstructor, EventTarget);
const windowPrototype = Object.create(EventTarget.prototype);
function Window() {
vm.createContext(this);
this._globalProxy = vm.runInContext("this", this);
Object.setPrototypeOf(this, windowPrototype);
const window = this;
Object.defineProperty(this, "window", {
get() {
return window._globalProxy;
},
enumerable: true,
configurable: true
});
}
const window = new Window();
console.log(vm.runInContext(`"addEventListener" in window`, window));
How often does it reproduce? Is there a required condition?
Every time
What is the expected behavior? Why is that the expected behavior?
Outputs true. (That occurs on v22.4.1.)
What do you see instead?
Outputs false
Additional information
No response
Metadata
Metadata
Assignees
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.v22.xIssues that can be reproduced on v22.x or PRs targeting the v22.x-staging branch.Issues that can be reproduced on v22.x or PRs targeting the v22.x-staging branch.vmIssues and PRs related to the vm subsystem.Issues and PRs related to the vm subsystem.