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

How do we distinguish between own and prototype properties? #67

Closed
aruneshchandra opened this issue Jan 27, 2017 · 3 comments
Closed

How do we distinguish between own and prototype properties? #67

aruneshchandra opened this issue Jan 27, 2017 · 3 comments

Comments

@aruneshchandra
Copy link
Contributor

Moving @fhinkel's comment from #33 to an issue:

Not V8 related, but do we need methods for own properties as well? Also, do we need a method that returns the property without invoking getters and interceptors (similar to v8::GetRealNamedProperty)?

@gabrielschulhof
Copy link
Collaborator

Actually this seems to be a major difference between 8.x and 6.2.0. On the latter, napi_get_property() will walk up the prototype chain, but in 8.x, the same function will only retrieve own properties. Maybe we have to be explicit about whether to walk up the prototype chain or not.

I think we need

napi_status napi_get_own_property(napi_env e,
                                  napi_value o,
                                  napi_propertyname p,
                                  napi_value* result);

which never walks up the prototype chain, and ensure that napi_get_property() always walks up the prototype chain.

@mhdawson
Copy link
Member

nodejs/node#13925

@digitalinfinity
Copy link
Contributor

I think this has been addressed by PR nodejs/node#14063. Feel free to reopen nodejs/node#13925 if that's not the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants