Skip to content

Commit

Permalink
src: fix node::FatalException
Browse files Browse the repository at this point in the history
PR-URL: #22654
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
  • Loading branch information
tniessen authored and targos committed Sep 3, 2018
1 parent a4545ad commit 8930268
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1484,8 +1484,8 @@ void FatalException(Isolate* isolate,
Environment* env = Environment::GetCurrent(isolate);
Local<Object> process_object = env->process_object();
Local<String> fatal_exception_string = env->fatal_exception_string();
Local<Function> fatal_exception_function =
process_object->Get(fatal_exception_string).As<Function>();
Local<Value> fatal_exception_function =
process_object->Get(fatal_exception_string);

if (!fatal_exception_function->IsFunction()) {
// Failed before the process._fatalException function was added!
Expand All @@ -1500,7 +1500,8 @@ void FatalException(Isolate* isolate,

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

if (fatal_try_catch.HasTerminated())
return;
Expand Down

0 comments on commit 8930268

Please sign in to comment.