Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
src: fix node::FatalException
  • Loading branch information
tniessen committed Sep 2, 2018
commit 3fdf2d09ecd228a9c8e08a639cfa6ab655ff2841
7 changes: 4 additions & 3 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1485,8 +1485,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 @@ -1501,7 +1501,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