-
-
Notifications
You must be signed in to change notification settings - Fork 478
Add API for getting object's property names #60
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
Conversation
napi.h
Outdated
@@ -523,6 +523,8 @@ namespace Napi { | |||
double numberValue ///< Property value | |||
); | |||
|
|||
Napi::Array GetPropertyNames(); ///< Get all property names |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's no need for the Napi::
prefix here, and also in the implementation. Of course it doesn't hurt, but I'd prefer to keep the code less verbose when possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add a test case to test/object.js
?
test/object.js
Outdated
assert.equal(arr.length, 3); | ||
arr.forEach(function(property, i){ | ||
assert.equal(property, expected[i]); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can simplify the 4 lines above with assert.deepStrictEqual()
.
Oh, do you need to take a dependency on this right away? If so, bump the version number to 0.3.4 in package.json, then after merging I can publish the update to npm. |
I published 0.3.4 to npm. |
No description provided.