Skip to content

Commit

Permalink
src: refactor to more safe method
Browse files Browse the repository at this point in the history
PR-URL: #32087
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
gengjiawen authored and MylesBorins committed Mar 24, 2020
1 parent 2262e7c commit d497f26
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/module_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1460,8 +1460,8 @@ static MaybeLocal<Promise> ImportModuleDynamically(

Local<PrimitiveArray> options = referrer->GetHostDefinedOptions();
if (options->Length() != HostDefinedOptions::kLength) {
Local<Promise::Resolver> resolver =
Promise::Resolver::New(context).ToLocalChecked();
Local<Promise::Resolver> resolver;
if (!Promise::Resolver::New(context).ToLocal(&resolver)) return {};
resolver
->Reject(context,
v8::Exception::TypeError(FIXED_ONE_BYTE_STRING(
Expand Down

0 comments on commit d497f26

Please sign in to comment.