Skip to content

Commit

Permalink
src: fix node::FatalException
Browse files Browse the repository at this point in the history
PR-URL: nodejs#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 addaleax committed Sep 2, 2018
1 parent 9f7efd5 commit b797103
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 @@ -1488,8 +1488,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 @@ -1504,7 +1504,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 b797103

Please sign in to comment.