Skip to content

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

Merged
merged 4 commits into from
Jun 13, 2017

Conversation

sampsongao
Copy link

No description provided.

@sampsongao sampsongao requested a review from jasongin June 13, 2017 18:54
napi.h Outdated
@@ -523,6 +523,8 @@ namespace Napi {
double numberValue ///< Property value
);

Napi::Array GetPropertyNames(); ///< Get all property names
Copy link
Member

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.

Copy link
Member

@jasongin jasongin left a 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]);
});
Copy link
Member

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().

@jasongin
Copy link
Member

jasongin commented Jun 13, 2017

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.

@jasongin jasongin merged commit 3aab97b into nodejs:master Jun 13, 2017
@jasongin
Copy link
Member

I published 0.3.4 to npm.

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

Successfully merging this pull request may close these issues.

2 participants