-
-
Notifications
You must be signed in to change notification settings - Fork 33.4k
Closed as not planned
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.stale
Description
What is the problem this feature will solve?
I'm having an issue with the vm module in Node.js.The function prototypes defined within a script using vm.runInContext do not match Function.prototype.
const vm = require('vm');
const context = vm.createContext({
console,
Function: Function
});
const script = new vm.Script(`
function test() {
return "Hello, World!";
}
console.log(test.prototype === Function.prototype); // Expected: true, Actual: false
`);
script.runInContext(context);
What is the feature you are proposing to solve the problem?
Tried using proxies, manual prototype setting, custom constructors, but none worked.
What alternatives have you considered?
No response
Metadata
Metadata
Assignees
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.stale
Type
Projects
Status
Awaiting Triage