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: Handle NULL env scenario #32230

Closed
wants to merge 1 commit into from
Closed

Conversation

himself65
Copy link
Member

related commit e9fa5ae

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

@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Mar 12, 2020
src/module_wrap.cc Outdated Show resolved Hide resolved
src/module_wrap.cc Outdated Show resolved Hide resolved
@mmarchini
Copy link
Contributor

I'm not familiar with modules code base, so maybe this suggestion doesn't apply here, but can/should we add a DCHECK before the return, so import.meta is uninitialized on Release builds, but we still check for this edge case on Debug builds?

@addaleax
Copy link
Member

@mmarchini If we were okay with having this crash, I think the CHECK could just stay.

Maybe to provide a bit of context, situations in which env == nullptr primarily target embedders (or maybe addons) that create v8::Contexts which aren’t associated with a Node.js Environment, and we don’t generally have a good way of handling that in our per-Isolate callbacks, other than maybe throwing an exception or ignoring the callback altogether. I think in this case the latter is an acceptable solution.

(That doesn’t mean that we have a “good” story for the embedder + ESM situation. That would be a larger conversation, I imagine.)

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@jasnell
Copy link
Member

jasnell commented Mar 17, 2020

@addaleax said:

@mmarchini If we were okay with having this crash, I think the CHECK could just stay

Is this blocking? It's not clear

@mmarchini
Copy link
Contributor

No, I think this is good to land. Was just trying to get a green CI first

@mmarchini mmarchini added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 17, 2020
mmarchini pushed a commit that referenced this pull request Mar 17, 2020
PR-URL: #32230
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matheus Marchini <mat@mmarchini.me>
@mmarchini
Copy link
Contributor

Landed in 960df3f

@mmarchini mmarchini closed this Mar 17, 2020
MylesBorins pushed a commit that referenced this pull request Mar 19, 2020
PR-URL: #32230
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matheus Marchini <mat@mmarchini.me>
@MylesBorins MylesBorins mentioned this pull request Mar 19, 2020
MylesBorins pushed a commit that referenced this pull request Mar 24, 2020
PR-URL: #32230
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matheus Marchini <mat@mmarchini.me>
targos pushed a commit that referenced this pull request Apr 22, 2020
PR-URL: #32230
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matheus Marchini <mat@mmarchini.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants