diff options
author | Daniel Bevenius <daniel.bevenius@gmail.com> | 2017-09-15 08:03:52 +0200 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2017-09-18 12:05:42 +0200 |
commit | bd8575287141bf52ad90d522e40998c52e8403aa (patch) | |
tree | e02cf364af5bf5cbe5abf0831bcba74915048edb /src/module_wrap.cc | |
parent | 9b996f01131164d606164224389d9e1ef9d69c9c (diff) | |
download | node-new-bd8575287141bf52ad90d522e40998c52e8403aa.tar.gz |
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: https://github.com/nodejs/node/pull/15423
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Diffstat (limited to 'src/module_wrap.cc')
-rw-r--r-- | src/module_wrap.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/module_wrap.cc b/src/module_wrap.cc index cd3cc2fde0..5d1d60e2be 100644 --- a/src/module_wrap.cc +++ b/src/module_wrap.cc @@ -23,6 +23,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; @@ -184,12 +185,12 @@ void ModuleWrap::Instantiate(const FunctionCallbackInfo<Value>& args) { ModuleWrap* obj = Unwrap<ModuleWrap>(that); Local<Module> mod = obj->module_.Get(iso); - bool ok = mod->Instantiate(ctx, ModuleWrap::ResolveCallback); + Maybe<bool> ok = mod->InstantiateModule(ctx, ModuleWrap::ResolveCallback); // clear resolve cache on instantiate obj->resolve_cache_.clear(); - if (!ok) { + if (!ok.FromMaybe(false)) { return; } } |