Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vm.runInContext() breaks delete on v18.2.0 #43129

Closed
alexlamsl opened this issue May 17, 2022 · 2 comments · Fixed by #46615
Closed

vm.runInContext() breaks delete on v18.2.0 #43129

alexlamsl opened this issue May 17, 2022 · 2 comments · Fixed by #46615
Labels
vm Issues and PRs related to the vm subsystem.

Comments

@alexlamsl
Copy link

alexlamsl commented May 17, 2022

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

@dnalborczyk
Copy link
Contributor

dnalborczyk commented May 17, 2022

introduced by: #42963

related: #42962

@alexlamsl
Copy link
Author

Still reproducible on v18.8.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vm Issues and PRs related to the vm subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants