diff options
author | legendecas <legendecas@gmail.com> | 2021-05-24 18:39:36 +0300 |
---|---|---|
committer | Michaƫl Zasso <targos@protonmail.com> | 2021-06-11 08:24:54 +0300 |
commit | 74f5e30d692e9559ee2d7521c9feddf55f941cc7 (patch) | |
tree | 590938b5550c7780ba115202079897780ec18038 /src | |
parent | 8115e6ee6d71beb683a447aeada5b924fb90c5d4 (diff) |
node-api: rtn pending excep on napi_new_instance
When there are any JavaScript exceptions pending,
`napi_pending_exception` should be returned.
PR-URL: https://github.com/nodejs/node/pull/38798
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/js_native_api_v8.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/js_native_api_v8.cc b/src/js_native_api_v8.cc index 1541f7eb36e..95f8212d870 100644 --- a/src/js_native_api_v8.cc +++ b/src/js_native_api_v8.cc @@ -2660,7 +2660,7 @@ napi_status napi_new_instance(napi_env env, auto maybe = ctor->NewInstance(context, argc, reinterpret_cast<v8::Local<v8::Value>*>(const_cast<napi_value*>(argv))); - CHECK_MAYBE_EMPTY(env, maybe, napi_generic_failure); + CHECK_MAYBE_EMPTY(env, maybe, napi_pending_exception); *result = v8impl::JsValueFromV8LocalValue(maybe.ToLocalChecked()); return GET_RETURN_STATUS(env); |