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
@rynz actually, it should be the other way around. Node.js ensures that all scopes are present by the time the OnOK/OnError callbacks get called. Thanks for noticing the discrepancy!
Can someone who is more familiar with this than I am check to see if there is still bad example code in node-addon-api/doc/async_worker.md It appears that the OnOK example is using the Napi::HandleScope when it is not necessary.
Activity
gabrielschulhof commentedon Jun 15, 2020
@rynz actually, it should be the other way around. Node.js ensures that all scopes are present by the time the
OnOK/OnErrorcallbacks get called. Thanks for noticing the discrepancy!We have additional documentation here: https://github.com/nodejs/node-addon-api/blob/master/doc/object_lifetime_management.md
rynz commentedon Jun 15, 2020
@gabrielschulhof thank you!
gotnone commentedon Jul 4, 2020
Can someone who is more familiar with this than I am check to see if there is still bad example code in node-addon-api/doc/async_worker.md It appears that the OnOK example is using the Napi::HandleScope when it is not necessary.
Thanks