Skip to content

Commit

Permalink
fix disabling JS in finalizers
Browse files Browse the repository at this point in the history
  • Loading branch information
vmoroz committed Jun 23, 2023
1 parent 1391400 commit f4e3bd2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/js_native_api_v8.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ void napi_env__::InvokeFinalizerFromGC(v8impl::RefTracker* finalizer) {
// node_api_post_finalizer.
if (last_error.error_code == napi_ok && last_exception.IsEmpty()) {
bool saved_suspend_call_into_js = suspend_call_into_js;
suspend_call_into_js = true;
finalizer->Finalize();
suspend_call_into_js = saved_suspend_call_into_js;
} else {
Expand Down

0 comments on commit f4e3bd2

Please sign in to comment.