You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
VM module doesn't handle undefined/NaN/null correctly #14660
undefined (and NaN and Infinity) is defined as unwritable, unconfigurable, unenumerable properties on the global object, and thus IMO should not be overridable through the VM module.
It is unclear if #13265 fixes this, probably not though as this issue concerns getting the value.
(I discovered it when debugging jsdom/jsdom#1932, which turns out to be primarily a bug on jsdom's side. I'm okay with closing this, but still keeping this open to see what anyone else thinks.)
I'm going to call this one of the things that one has to take care of when trying to use the vm module "correctly". It's not within our power to fix as it originates in V8, and it's pretty difficult to fix even on the V8 end.
Activity
TimothyGu commentedon Aug 7, 2017
(I discovered it when debugging jsdom/jsdom#1932, which turns out to be primarily a bug on jsdom's side. I'm okay with closing this, but still keeping this open to see what anyone else thinks.)
bnoordhuis commentedon Aug 7, 2017
I suspect this is a V8 bug that has since been fixed because I can't reproduce with today's master; I can with the v8.x branch.
TimothyGu commentedon Aug 8, 2017
@bnoordhuis In master the first case returns
undefinedbut the second still evaluates to123…bnoordhuis commentedon Aug 8, 2017
Sorry yes, I was referring to the first case. The second one is a bug in the vm module, not V8.
(Or bug... it makes perfect sense in the proxy-to-another-object model, but it's different from a native context.)
maclover7 commentedon Oct 23, 2017
As of f1d6b04, it looks like this behavior has changed a little bit:
TimothyGu commentedon Aug 18, 2018
I'm going to call this one of the things that one has to take care of when trying to use the
vmmodule "correctly". It's not within our power to fix as it originates in V8, and it's pretty difficult to fix even on the V8 end.