From 17db407ba2fa159455bc3f37bd59b28fd5090285 Mon Sep 17 00:00:00 2001 From: Romain Lanz Date: Sun, 21 Oct 2018 18:25:01 +0200 Subject: [PATCH] src: refactor deprecated v8::Function::Call call MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs: https://github.com/nodejs/node/pull/23414#issuecomment-428815506 PR-URL: https://github.com/nodejs/node/pull/23804 Reviewed-By: Anna Henningsen Reviewed-By: Michaƫl Zasso Reviewed-By: Refael Ackermann Reviewed-By: Denys Otrishko Reviewed-By: James M Snell --- src/node.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/node.cc b/src/node.cc index a6728b7fb0fd5a..9fb5ab3b8e1d3d 100644 --- a/src/node.cc +++ b/src/node.cc @@ -1384,9 +1384,8 @@ void FatalException(Isolate* isolate, fatal_try_catch.SetVerbose(false); // This will return true if the JS layer handled it, false otherwise - Local caught = - fatal_exception_function.As() - ->Call(process_object, 1, &error); + MaybeLocal caught = fatal_exception_function.As()->Call( + env->context(), process_object, 1, &error); if (fatal_try_catch.HasTerminated()) return; @@ -1395,7 +1394,7 @@ void FatalException(Isolate* isolate, // The fatal exception function threw, so we must exit ReportException(env, fatal_try_catch); exit(7); - } else if (caught->IsFalse()) { + } else if (caught.ToLocalChecked()->IsFalse()) { ReportException(env, error, message); // fatal_exception_function call before may have set a new exit code ->