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
Object::get_own_property_names should act like Object.getOwnPropertyNames does in JS, but there was no n-api function available to do exactly that. Instead, we're using napi_get_property_names, which acts more like for (var key in object), including properties from the prototype and the like.
There is an napi_get_all_property_names API that would allow implementing Object::get_own_property_names correctly, and with a lot less code to boot. At the time of the PR, it was still in the process of being backported. Once it is available in all release lines (Node.js 10/12/13/14), we can switch to napi_get_all_property_names.
The text was updated successfully, but these errors were encountered:
Object::get_own_property_names
should act likeObject.getOwnPropertyNames
does in JS, but there was no n-api function available to do exactly that. Instead, we're usingnapi_get_property_names
, which acts more likefor (var key in object)
, including properties from the prototype and the like.Right now, we're doing this load of work to paper over that: https://github.com/goto-bus-stop/neon/blob/9b338f9ed0a8dcb781566b61bc06b67f07ca23a1/crates/neon-runtime/src/napi/object.rs#L17-L84
But it's still not accurate.
There is an
napi_get_all_property_names
API that would allow implementingObject::get_own_property_names
correctly, and with a lot less code to boot. At the time of the PR, it was still in the process of being backported. Once it is available in all release lines (Node.js 10/12/13/14), we can switch tonapi_get_all_property_names
.The text was updated successfully, but these errors were encountered: