diff options
author | Daniel Bevenius <daniel.bevenius@gmail.com> | 2020-12-17 07:17:38 +0300 |
---|---|---|
committer | Daniel Bevenius <daniel.bevenius@gmail.com> | 2020-12-22 11:28:23 +0300 |
commit | fc8fcb084d514b5a21e8c846d039bf95f3dbe910 (patch) | |
tree | 1d6225b76fd75cc91d2876f96e75a412e4ec40a9 /src/node_errors.cc | |
parent | 21f2e8859dfbf09f85c1cffe14867a4d2103417c (diff) |
src: remove unnecessary ToLocalChecked node_errors
PR-URL: https://github.com/nodejs/node/pull/36547
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'src/node_errors.cc')
-rw-r--r-- | src/node_errors.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/node_errors.cc b/src/node_errors.cc index 5099ac03ddf..3107f46b4dc 100644 --- a/src/node_errors.cc +++ b/src/node_errors.cc @@ -954,7 +954,7 @@ void TriggerUncaughtException(Isolate* isolate, return; } - MaybeLocal<Value> handled; + MaybeLocal<Value> maybe_handled; if (env->can_call_into_js()) { // We do not expect the global uncaught exception itself to throw any more // exceptions. If it does, exit the current Node.js instance. @@ -968,7 +968,7 @@ void TriggerUncaughtException(Isolate* isolate, Local<Value> argv[2] = { error, Boolean::New(env->isolate(), from_promise) }; - handled = fatal_exception_function.As<Function>()->Call( + maybe_handled = fatal_exception_function.As<Function>()->Call( env->context(), process_object, arraysize(argv), argv); } @@ -976,7 +976,8 @@ void TriggerUncaughtException(Isolate* isolate, // instance so return to continue the exit routine. // TODO(joyeecheung): return a Maybe here to prevent the caller from // stepping on the exit. - if (handled.IsEmpty()) { + Local<Value> handled; + if (!maybe_handled.ToLocal(&handled)) { return; } @@ -986,7 +987,7 @@ void TriggerUncaughtException(Isolate* isolate, // TODO(joyeecheung): This has been only checking that the return value is // exactly false. Investigate whether this can be turned to an "if true" // similar to how the worker global uncaught exception handler handles it. - if (!handled.ToLocalChecked()->IsFalse()) { + if (!handled->IsFalse()) { return; } |