-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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: When applied result of vm.runInContext in 'Object.getOwnPropertyNames(result)' ignores its own property #3158
Comments
I can confirm the issue. I think it's because /cc @domenic |
const ownKeys = Object.keys(result);
console.log(ownKeys.indexOf('firstName')); // 0 @bnoordhuis |
Which Node version? We recently fixed something related in v3 I think. The hidden prototype stuff should be unobservable IIRC, and the inconsistency implies something is going wrong here, so yeah, this should be fixable. Even if it's just a V8 issue. One thing I've been meaning to investigate is using non-masking mode which might help with some of these issues... |
@domenic I have tested against v4.1.1 |
Implementation-wise it's nuanced. I did notice that V8's (It does have logic around named interceptors using |
@bnoordhuis Is this same hidden prototype issue? |
@princejwesley No, if I understand you right. Each VM context has its own instance of Example:
And to be clear, when you call |
@bnoordhuis thanks, it make sense now. |
@bnoordhuis ... is this actually a bug? this is definitely still happening but it's not clear if it's something that needs fixed. |
It's fixed in master thanks to a recent V8 upgrade. We'll be shipping that as v6.0.0 later this month so I'll go ahead and close the issue. |
gives
In the above example,
Object.getOwnPropertyNames(result)
is not returning its own property.It affects REPL auto-completion results when
useGlobal
is false.The text was updated successfully, but these errors were encountered: