diff --git a/src/js_native_api_v8.h b/src/js_native_api_v8.h index 673e697dd6ba1b..bdf68505a7d7a3 100644 --- a/src/js_native_api_v8.h +++ b/src/js_native_api_v8.h @@ -56,6 +56,7 @@ struct napi_env__ { : isolate(context->GetIsolate()), context_persistent(isolate, context) { CHECK_EQ(isolate, context->GetIsolate()); + napi_clear_last_error(this); } virtual ~napi_env__() { // First we must finalize those references that have `napi_finalizer`