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 NaN, Infinity, undefined property descriptor inconsistent with global #18551

Closed
Fetz opened this issue Feb 3, 2018 · 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

@Fetz
Copy link

Fetz commented Feb 3, 2018

  • Version: v.9.5.0
  • Platform: Mac 10.11.6 (15G18013)
  • Subsystem: vm
var sandbox = vm.createContext({});
Object.getOwnPropertyDescriptor(vm.runInContext("this", sandbox), "NaN");
{ value: NaN,
  writable: true,
  enumerable: false,
  configurable: true }

Is this behaviour expected? Because is not consistent with the global object.

> Object.getOwnPropertyDescriptor(global, "NaN")
{ value: NaN,
  writable: false,
  enumerable: false,
  configurable: false }

And the behaviour is not consistent with the previous version of Node

  • Version: v.8.5.0
  • Platform: Mac 10.11.6 (15G18013)
  • Subsystem: vm
var sandbox = vm.createContext({});
Object.getOwnPropertyDescriptor(vm.runInContext("this", sandbox), "NaN");
{ value: NaN,
  writable: false,
  enumerable: false,
  configurable: false }

I noticed this bug when working on this jsdom PR

@TimothyGu TimothyGu added vm Issues and PRs related to the vm subsystem. duplicate Issues and PRs that are duplicates of other issues or PRs. labels Feb 3, 2018
@TimothyGu
Copy link
Member

Seems to be a duplicate of #14660, another long-standing issue...

@TimothyGu
Copy link
Member

Actually, #17481 is more appropriate. All of these vm issues overlap greatly, so it can be difficult to figure out what exact issue a specific issue is equivalent to.

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