vm.runInContext() breaks delete on v18.2.0 #43129
Copy link
Copy link
Closed
Labels
vmIssues and PRs related to the vm subsystem.Issues and PRs related to the vm subsystem.
Description
Version
v18.2.0
Platform
Microsoft Windows [Version 10.0.14393]
Subsystem
vm
What steps will reproduce the bug?
$ cat test.js
var a = "direct";
delete a;
console.log(a);
var vm = require('vm');
vm.runInThisContext(`
var b = "this";
delete b;
console.log(b);
`);
vm.runInContext(`
var c = "new";
delete c;
console.log(c);
`, vm.createContext({ console: console }));How often does it reproduce? Is there a required condition?
Always
What is the expected behavior?
$ node -v
v4.9.1
v6.17.1
v8.17.0
v10.24.1
v12.22.12
v14.19.1
v16.14.2
v18.0.0
$ cat test.js | node
direct
this
newWhat do you see instead?
$ node -v
v18.2.0
$ cat test.js | node
direct
this
undefinedAdditional information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
vmIssues and PRs related to the vm subsystem.Issues and PRs related to the vm subsystem.
Activity
dnalborczyk commentedon May 17, 2022
introduced by: #42963
related: #42962
alexlamsl commentedon Aug 26, 2022
Still reproducible on v18.8.0