-
Notifications
You must be signed in to change notification settings - Fork 28.2k
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
Allow napi_add_finalizer to work on primitive types #48311
Comments
@vmoroz WDYT? |
Finalizers are implemented via |
@toyobayashi V8 has support for weak references to primitive types. @vmoroz implemented support for such weak references in #45715 for |
@gabrielschulhof , I am curious how it could be implemented for the primitive types:
Do you know if V8 supports calling finalizers for primitive types? |
@gabrielschulhof yes I know the implementation detail of #45715 and toyobayashi/emnapi#64 implemented it. I'm not sure if adding finalizer to primitive types could be implemented in emnapi, even if v8 supports, emnapi can't access v8 API, it relies on |
Oh, I see now. References can be created for primitive types, but not weak ones. |
What is the problem this feature will solve?
We may want to have feature parity with
napi_create_reference
, since, internally, both create a reference.@nodejs/node-api WDYT?
What is the feature you are proposing to solve the problem?
Open up napi_add_finalizer to primitive types.
What alternatives have you considered?
No response
The text was updated successfully, but these errors were encountered: