Closed
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
new
What do you see instead?
$ node -v
v18.2.0
$ cat test.js | node
direct
this
undefined
Additional information
No response