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

n-api: use napi_get_all_property_names #601

Merged
merged 2 commits into from
Sep 22, 2020

Conversation

goto-bus-stop
Copy link
Member

This makes the JsObject::get_own_property_names actually correct. napi_get_all_property_names was added in N-API version 6, so it raises our support floor to Node.js v10.20.0.

}
fixed_len += 1;
}
*out = property_names.assume_init();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just noticed this. I'll write a ticket for some clean-up in neon. This should probably also be using a MaybeUninit on the calling side or be returning an Option instead fo a boolean.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this is a common pattern throughout neon-runtime. Since these runtime functions don't need to be FFI-safe anymore with N-API, we can safely use things like Options for this stuff, but it probably needs to wait until the NAN backend is removed.

@kjvalencik
Copy link
Member

@goto-bus-stop Great clean-up! Much nicer! 🎉

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