Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: use InstantiateModule instead of deprecated #15423

Conversation

danbev
Copy link
Contributor

@danbev danbev commented Sep 15, 2017

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.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

src

@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Sep 15, 2017

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

if (!ok) {
if (!ok.ToChecked()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok.FromMaybe(false)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I was not aware of that function. Thanks.

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>.
@danbev danbev force-pushed the module_wrap_instantiate_deprecation_warning branch from 51bc74b to 3ebf050 Compare September 15, 2017 09:24
@danbev
Copy link
Contributor Author

danbev commented Sep 15, 2017

@mscdex mscdex added the esm Issues and PRs related to the ECMAScript Modules implementation. label Sep 15, 2017
@targos
Copy link
Member

targos commented Sep 18, 2017

Landed in bd85752

@targos targos closed this Sep 18, 2017
targos pushed a commit that referenced this pull request Sep 18, 2017
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 <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>
@jasnell
Copy link
Member

jasnell commented Sep 20, 2017

If I understand this correctly, this depends on v8 6.1 correct? So it cannot be backported to v8.x until 8.1 lands. Ping @MylesBorins so this is on the radar for when v8 6.1 lands.

Qard pushed a commit to Qard/ayo that referenced this pull request Sep 21, 2017
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: nodejs/node#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>
Qard pushed a commit to Qard/ayo that referenced this pull request Sep 21, 2017
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: nodejs/node#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>
MylesBorins pushed a commit that referenced this pull request Sep 28, 2017
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 <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>
MylesBorins pushed a commit that referenced this pull request Sep 29, 2017
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 <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>
@MylesBorins MylesBorins mentioned this pull request Oct 3, 2017
MylesBorins pushed a commit that referenced this pull request Oct 3, 2017
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 <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>
@danbev danbev deleted the module_wrap_instantiate_deprecation_warning branch November 16, 2017 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. esm Issues and PRs related to the ECMAScript Modules implementation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants