Add API for getting object's property names#60
Merged
jasongin merged 4 commits intonodejs:masterfrom Jun 13, 2017
Merged
Conversation
jasongin
reviewed
Jun 13, 2017
napi.h
Outdated
| double numberValue ///< Property value | ||
| ); | ||
|
|
||
| Napi::Array GetPropertyNames(); ///< Get all property names |
Member
There was a problem hiding this comment.
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.
jasongin
suggested changes
Jun 13, 2017
Member
jasongin
left a comment
There was a problem hiding this comment.
Can you also add a test case to test/object.js?
jasongin
reviewed
Jun 13, 2017
test/object.js
Outdated
| assert.equal(arr.length, 3); | ||
| arr.forEach(function(property, i){ | ||
| assert.equal(property, expected[i]); | ||
| }); |
Member
There was a problem hiding this comment.
You can simplify the 4 lines above with assert.deepStrictEqual().
jasongin
approved these changes
Jun 13, 2017
Member
|
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. |
Member
|
I published 0.3.4 to npm. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.