Skip to content

Commit 8930268

Browse files
tniessentargos
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 a4545ad commit 8930268

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/node.cc

+4-3
Original file line numberDiff line numberDiff line change
@@ -1484,8 +1484,8 @@ void FatalException(Isolate* isolate,
14841484
Environment* env = Environment::GetCurrent(isolate);
14851485
Local<Object> process_object = env->process_object();
14861486
Local<String> fatal_exception_string = env->fatal_exception_string();
1487-
Local<Function> fatal_exception_function =
1488-
process_object->Get(fatal_exception_string).As<Function>();
1487+
Local<Value> fatal_exception_function =
1488+
process_object->Get(fatal_exception_string);
14891489

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

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

15051506
if (fatal_try_catch.HasTerminated())
15061507
return;

0 commit comments

Comments
 (0)