You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The add-on maintainer would attach a callback similarly to the napi_set_instance_data finalizer, which would get called whenever we would otherwise return napi_cannot_call_into_js. The callback would analyze the reason and the associated reason_data (which would be a pointer to a stack-allocated structure the type of which depends on reason – a little bit like ioctl(2)) and would return a napi_status that would then be passed as the return value to the original Node-API call.
This could be used to correct a return value of napi_pending_exception from a call to, say, napi_call_function into a return value of napi_ok.
The text was updated successfully, but these errors were encountered:
@legendecas also suggested we should investigate if there is any way we can change the sequence of operations so you can executed JS. For example move up in the env teardown sequence.
Re #30327 #37236
One (somewhat elaborate?) API for semver-minorly handling the inability to execute JS would be the following (somewhat introspective) API:
The add-on maintainer would attach a callback similarly to the
napi_set_instance_data
finalizer, which would get called whenever we would otherwise returnnapi_cannot_call_into_js
. The callback would analyze the reason and the associatedreason_data
(which would be a pointer to a stack-allocated structure the type of which depends onreason
– a little bit likeioctl(2)
) and would return anapi_status
that would then be passed as the return value to the original Node-API call.This could be used to correct a return value of
napi_pending_exception
from a call to, say,napi_call_function
into a return value ofnapi_ok
.The text was updated successfully, but these errors were encountered: