Skip to content

Commit

Permalink
src: refactor deprecated v8::Function::Call call
Browse files Browse the repository at this point in the history
Refs: #23414 (comment)

PR-URL: #23804
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
RomainLanz authored and MylesBorins committed Nov 26, 2018
1 parent b2fbefb commit 2e3e68a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1384,9 +1384,8 @@ void FatalException(Isolate* isolate,
fatal_try_catch.SetVerbose(false);

// This will return true if the JS layer handled it, false otherwise
Local<Value> caught =
fatal_exception_function.As<Function>()
->Call(process_object, 1, &error);
MaybeLocal<Value> caught = fatal_exception_function.As<Function>()->Call(
env->context(), process_object, 1, &error);

if (fatal_try_catch.HasTerminated())
return;
Expand All @@ -1395,7 +1394,7 @@ void FatalException(Isolate* isolate,
// The fatal exception function threw, so we must exit
ReportException(env, fatal_try_catch);
exit(7);
} else if (caught->IsFalse()) {
} else if (caught.ToLocalChecked()->IsFalse()) {
ReportException(env, error, message);

// fatal_exception_function call before may have set a new exit code ->
Expand Down

0 comments on commit 2e3e68a

Please sign in to comment.