Skip to content

Commit b797103

Browse files
tniessenaddaleax
authored andcommitted
src: fix node::FatalException
PR-URL: #22654 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Denys Otrishko <[email protected]>
1 parent 9f7efd5 commit b797103

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/node.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1488,8 +1488,8 @@ void FatalException(Isolate* isolate,
14881488
Environment* env = Environment::GetCurrent(isolate);
14891489
Local<Object> process_object = env->process_object();
14901490
Local<String> fatal_exception_string = env->fatal_exception_string();
1491-
Local<Function> fatal_exception_function =
1492-
process_object->Get(fatal_exception_string).As<Function>();
1491+
Local<Value> fatal_exception_function =
1492+
process_object->Get(fatal_exception_string);
14931493

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

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

15091510
if (fatal_try_catch.HasTerminated())
15101511
return;

0 commit comments

Comments
 (0)