module: Fix bug for undefined CJS dependency loading from loader hook file#16381
Closed
guybedford wants to merge 1 commit intonodejs:masterfrom
Closed
module: Fix bug for undefined CJS dependency loading from loader hook file#16381guybedford wants to merge 1 commit intonodejs:masterfrom
guybedford wants to merge 1 commit intonodejs:masterfrom
Conversation
jasnell
approved these changes
Oct 22, 2017
cjihrig
approved these changes
Oct 23, 2017
Contributor
Author
|
Would it be possible to get a CI run here? |
Member
|
CI is currently locked because of the security release |
Contributor
Author
|
Thanks @targos, if that's clear now are we good to go? |
Member
Contributor
Author
|
Ok, looks like all are passing except for one failure which seems CI-system-related. |
Contributor
Author
|
Would it be possible to merge this yet? |
targos
approved these changes
Oct 28, 2017
Member
|
Landed in d853758. Thanks! |
targos
pushed a commit
that referenced
this pull request
Oct 28, 2017
It can be useful to load dependencies as part of the loader hook definition file. This fixes a bug where `import x from 'x'` would always return `x` as `undefined` if the import was made in a loader hooks definition module. A parallel change to the CJS loading injection process meant that the CJS module wasn't being injected into the correct loader instance, which is corrected here with a test. PR-URL: #16381 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
Contributor
Author
|
Thanks so much for the quick merge @targos. |
gibfahn
pushed a commit
that referenced
this pull request
Oct 30, 2017
It can be useful to load dependencies as part of the loader hook definition file. This fixes a bug where `import x from 'x'` would always return `x` as `undefined` if the import was made in a loader hooks definition module. A parallel change to the CJS loading injection process meant that the CJS module wasn't being injected into the correct loader instance, which is corrected here with a test. PR-URL: #16381 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
gibfahn
pushed a commit
that referenced
this pull request
Oct 30, 2017
It can be useful to load dependencies as part of the loader hook definition file. This fixes a bug where `import x from 'x'` would always return `x` as `undefined` if the import was made in a loader hooks definition module. A parallel change to the CJS loading injection process meant that the CJS module wasn't being injected into the correct loader instance, which is corrected here with a test. PR-URL: #16381 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
gibfahn
pushed a commit
that referenced
this pull request
Oct 31, 2017
It can be useful to load dependencies as part of the loader hook definition file. This fixes a bug where `import x from 'x'` would always return `x` as `undefined` if the import was made in a loader hooks definition module. A parallel change to the CJS loading injection process meant that the CJS module wasn't being injected into the correct loader instance, which is corrected here with a test. PR-URL: #16381 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
Merged
Qard
pushed a commit
to ayojs/ayo
that referenced
this pull request
Nov 2, 2017
It can be useful to load dependencies as part of the loader hook definition file. This fixes a bug where `import x from 'x'` would always return `x` as `undefined` if the import was made in a loader hooks definition module. A parallel change to the CJS loading injection process meant that the CJS module wasn't being injected into the correct loader instance, which is corrected here with a test. PR-URL: nodejs/node#16381 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
Qard
pushed a commit
to ayojs/ayo
that referenced
this pull request
Nov 2, 2017
It can be useful to load dependencies as part of the loader hook definition file. This fixes a bug where `import x from 'x'` would always return `x` as `undefined` if the import was made in a loader hooks definition module. A parallel change to the CJS loading injection process meant that the CJS module wasn't being injected into the correct loader instance, which is corrected here with a test. PR-URL: nodejs/node#16381 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
Contributor
|
Assuming we shouldn't backport this to v6.x Please lmk if I am mistaken |
addaleax
pushed a commit
to ayojs/ayo
that referenced
this pull request
Dec 7, 2017
It can be useful to load dependencies as part of the loader hook definition file. This fixes a bug where `import x from 'x'` would always return `x` as `undefined` if the import was made in a loader hooks definition module. A parallel change to the CJS loading injection process meant that the CJS module wasn't being injected into the correct loader instance, which is corrected here with a test. PR-URL: nodejs/node#16381 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It can be useful to load dependencies as part of the loader hook definition file. This fixes a bug where
import x from 'x'would always returnxasundefinedif the import was made in a loader hooks definition module.A parallel change to the CJS loading injection process which happens in https://github.com/nodejs/node/blob/master/lib/module.js#L521 meant that the CJS module wasn't being injected into the correct loader instance, which is corrected here with a test.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
esmodules