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
How do we distinguish between own and prototype properties? #67
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)?
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.
Activity
gabrielschulhof commentedon Feb 21, 2017
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 commentedon Jun 26, 2017
nodejs/node#13925
digitalinfinity commentedon Aug 30, 2017
I think this has been addressed by PR nodejs/node#14063. Feel free to reopen nodejs/node#13925 if that's not the case.