vtshaver
vtshaver copied to clipboard
`napi_get_property_names` is buggy in node 10.19
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 nice catch. Can you try to track down what change in node core fixed what you are seeing? Also, could this explain https://github.com/mapbox/vtshaver/pull/40 ?
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.
yep, https://github.com/mapbox/vtshaver/issues/40 looks related. I'll investigate further and add workaround in our code if required. /cc @springmeyer
thanks @artemp - I feel pretty good about #40 as a workaround, but let me know if you see a better one.
@springmeyer - re: https://github.com/mapbox/vtshaver/pull/40 fix - ideally we shouldn't use v8 methods from N-api module.
ideally we shouldn't use v8 methods from N-api module.
Ah, good point.
Fix
Napi::String Napi::Value::ToString() const;
^^ Returns the Napi::Value coerced to a JavaScript string. /cc @springmeyer