diff --git a/src/module_wrap.cc b/src/module_wrap.cc index 99a0371df63893..a117ba24bf852f 100644 --- a/src/module_wrap.cc +++ b/src/module_wrap.cc @@ -24,6 +24,7 @@ using v8::IntegrityLevel; using v8::Isolate; using v8::JSON; using v8::Local; +using v8::Maybe; using v8::MaybeLocal; using v8::Module; using v8::Object; @@ -178,14 +179,14 @@ void ModuleWrap::Instantiate(const FunctionCallbackInfo& args) { ModuleWrap* obj = Unwrap(that); Local mod = obj->module_.Get(iso); - bool ok = mod->Instantiate(ctx, ModuleWrap::ResolveCallback); + Maybe ok = mod->InstantiateModule(ctx, ModuleWrap::ResolveCallback); // clear resolve cache on instantiate for (auto& entry : obj->resolve_cache_) entry.second.Reset(); obj->resolve_cache_.clear(); - if (!ok) { + if (!ok.FromMaybe(false)) { return; } }