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: Unexpected behavior in vm.runInContext #3521

Closed
princejwesley opened this issue Oct 26, 2015 · 2 comments
Closed

VM: Unexpected behavior in vm.runInContext #3521

princejwesley opened this issue Oct 26, 2015 · 2 comments
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs. vm Issues and PRs related to the vm subsystem.

Comments

@princejwesley
Copy link
Contributor

'use strict';
const vm = require('vm');

let obj = {};

const ctx = vm.createContext(obj);
vm.runInContext('name = 1', ctx);
console.log(obj);
vm.runInContext('function name() {}', ctx);
console.log(obj);

gives

{ name: 1 }
{ name: 1 }

vm.runInContext fails to overwrite name property of given context.

Tested versions: v4.1.1 & v4.2.1

@brendanashworth brendanashworth added the vm Issues and PRs related to the vm subsystem. label Oct 26, 2015
@brendanashworth
Copy link
Contributor

I think this is a duplicate of #548. @princejwesley does that seem right?

@princejwesley
Copy link
Contributor Author

@brendanashworth Yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs. vm Issues and PRs related to the vm subsystem.
Projects
None yet
Development

No branches or pull requests

2 participants