Skip to content
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

napi_get_property_names is buggy in node 10.19 #42

Open
artemp opened this issue Apr 9, 2020 · 7 comments
Open

napi_get_property_names is buggy in node 10.19 #42

artemp opened this issue Apr 9, 2020 · 7 comments
Assignees
Labels
bug Something isn't working dependencies Pull requests that update a dependency file

Comments

@artemp
Copy link
Contributor

artemp commented Apr 9, 2020

napi_get_property_names(_env, _value, &result);

erroneously returns Number type when property name has only digit literals e.g '123'

This has been fixed in node >=12 (tested 12.16.1, 13.12.0)
/cc @springmeyer

@artemp artemp added bug Something isn't working dependencies Pull requests that update a dependency file labels Apr 9, 2020
@artemp artemp self-assigned this Apr 9, 2020
@springmeyer
Copy link
Contributor

@artemp nice catch. Can you try to track down what change in node core fixed what you are seeing? Also, could this explain #40 ?

@springmeyer
Copy link
Contributor

Also, could this explain #40

This btw seemed to me like a v8 behavior rather than node core or Nan related, but I'm not positive.

@artemp
Copy link
Contributor Author

artemp commented Apr 9, 2020

yep, #40 looks related. I'll investigate further and add workaround in our code if required.
/cc @springmeyer

@springmeyer
Copy link
Contributor

thanks @artemp - I feel pretty good about #40 as a workaround, but let me know if you see a better one.

@artemp
Copy link
Contributor Author

artemp commented Apr 9, 2020

@springmeyer - re: #40 fix - ideally we shouldn't use v8 methods from N-api module.

@springmeyer
Copy link
Contributor

ideally we shouldn't use v8 methods from N-api module.

Ah, good point.

@artemp
Copy link
Contributor Author

artemp commented Apr 10, 2020

Fix

Napi::String Napi::Value::ToString() const;

^^ Returns the Napi::Value coerced to a JavaScript string.
/cc @springmeyer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies Pull requests that update a dependency file
Projects
None yet
Development

No branches or pull requests

2 participants