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 <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Jan Krems <[email protected]>
Reviewed-By: Shelley Vohr <[email protected]>
Reviewed-By: David Carlier <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • 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.