-
Notifications
You must be signed in to change notification settings - Fork 34
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_wrap only allow one wrapper to one object #266
Comments
My first thought is that we should add a napi_remove_wrap(napi_env env, napi_value wrapper); This would cover the case where you want to associate new object to a wrapper (which we know is needed by node-sass) and the case where you just want to remove the wrapping from an object. The other option is simply to remove the existing check and allow the second wrap to just succeed. I'm thinking its better to be sure it was the intention of the developer by having them use napi_remove_wrap. @nodejs/addon-api what are your thoughts. |
Calling napi_wrap() twice on the same object has the result of returning napi_invalid_arg on the second call. However, sometimes it is necessary to replace the native pointer associated with a given object. This new API allows one to remove an existing pointer, returning the object to its pristine, non-wrapped state. Fixes: nodejs/abi-stable-node#266
Calling napi_wrap() twice on the same object has the result of returning napi_invalid_arg on the second call. However, sometimes it is necessary to replace the native pointer associated with a given object. This new API allows one to remove an existing pointer, returning the object to its pristine, non-wrapped state. PR-URL: nodejs/node#14658 Reviewed-By: Michael Dawson <[email protected]> Fixes: nodejs/abi-stable-node#266
Calling napi_wrap() twice on the same object has the result of returning napi_invalid_arg on the second call. However, sometimes it is necessary to replace the native pointer associated with a given object. This new API allows one to remove an existing pointer, returning the object to its pristine, non-wrapped state. PR-URL: nodejs/node#14658 Reviewed-By: Michael Dawson <[email protected]> Fixes: nodejs/abi-stable-node#266
Calling napi_wrap() twice on the same object has the result of returning napi_invalid_arg on the second call. However, sometimes it is necessary to replace the native pointer associated with a given object. This new API allows one to remove an existing pointer, returning the object to its pristine, non-wrapped state. PR-URL: #14658 Reviewed-By: Michael Dawson <[email protected]> Fixes: nodejs/abi-stable-node#266
Calling napi_wrap() twice on the same object has the result of returning napi_invalid_arg on the second call. However, sometimes it is necessary to replace the native pointer associated with a given object. This new API allows one to remove an existing pointer, returning the object to its pristine, non-wrapped state. PR-URL: #14658 Reviewed-By: Michael Dawson <[email protected]> Fixes: nodejs/abi-stable-node#266
Calling napi_wrap() twice on the same object has the result of returning napi_invalid_arg on the second call. However, sometimes it is necessary to replace the native pointer associated with a given object. This new API allows one to remove an existing pointer, returning the object to its pristine, non-wrapped state. PR-URL: nodejs#14658 Reviewed-By: Michael Dawson <[email protected]> Fixes: nodejs/abi-stable-node#266
Calling napi_wrap() twice on the same object has the result of returning napi_invalid_arg on the second call. However, sometimes it is necessary to replace the native pointer associated with a given object. This new API allows one to remove an existing pointer, returning the object to its pristine, non-wrapped state. Backport-PR-URL: #19447 PR-URL: #14658 Reviewed-By: Michael Dawson <[email protected]> Fixes: nodejs/abi-stable-node#266
I was updating the node-sass code to the current napi and I found an issue with napi_wrap check. So in napi_wrap, if we see the object is a wrapper, we return napi_invalid_arg. However, in node-sass, we do something like this:
The text was updated successfully, but these errors were encountered: