Skip to content

Commit bd85752

Browse files
danbevtargos
authored andcommitted
src: use InstantiateModule instead of deprecated
The following deprecation warning is displayed when compiling: ../src/module_wrap.cc:187:18: warning: 'Instantiate' is deprecated [-Wdeprecated-declarations] bool ok = mod->Instantiate(ctx, ModuleWrap::ResolveCallback); ^ ../deps/v8/include/v8.h:1158:22: note: 'Instantiate' has been explicitly marked deprecated here bool Instantiate(Local<Context> context, ^ This commit changes this function call to use InstantiateModule instead which returns a Maybe<bool>. PR-URL: #15423 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
1 parent 9b996f0 commit bd85752

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/module_wrap.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ using v8::IntegrityLevel;
2323
using v8::Isolate;
2424
using v8::JSON;
2525
using v8::Local;
26+
using v8::Maybe;
2627
using v8::MaybeLocal;
2728
using v8::Module;
2829
using v8::Object;
@@ -184,12 +185,12 @@ void ModuleWrap::Instantiate(const FunctionCallbackInfo<Value>& args) {
184185

185186
ModuleWrap* obj = Unwrap<ModuleWrap>(that);
186187
Local<Module> mod = obj->module_.Get(iso);
187-
bool ok = mod->Instantiate(ctx, ModuleWrap::ResolveCallback);
188+
Maybe<bool> ok = mod->InstantiateModule(ctx, ModuleWrap::ResolveCallback);
188189

189190
// clear resolve cache on instantiate
190191
obj->resolve_cache_.clear();
191192

192-
if (!ok) {
193+
if (!ok.FromMaybe(false)) {
193194
return;
194195
}
195196
}

0 commit comments

Comments
 (0)