lib: include cached modules in module.children#14132
lib: include cached modules in module.children#14132bnoordhuis merged 1 commit intonodejs:masterfrom
Conversation
test/fixtures/GH-7131/a.js
Outdated
There was a problem hiding this comment.
I picked a module that's unlikely to have already been included by test/common.js.
|
Worth a CitGM run: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/899/ |
|
Does this mean that a structure |
|
@Slayer95 Yes, there can be cycles now. (That's the reason for the changes to test/sequential/test-module-loading.js: it didn't handle them.) |
There was a problem hiding this comment.
Mwah, I can change that if you feel strongly but we have a gazillion tests that use simple string concatenation.
There was a problem hiding this comment.
I'd prefer it. Updating the remaining ones for consistency would be a good Code-and-Learn activity (ping @nodejs/codeandlearn)
There was a problem hiding this comment.
I'm not sure since https://nodejs.org/api/modules.html#modules_all_together (module names are URL like)
Maybe path.posix.join, but I'm +1 on literal /
There was a problem hiding this comment.
@refack to be clear, you're saying that path.join() is wrong because it'll resolve to a\\b on Windows, and require always takes a POSIX style path (a/b)?
I'd rather have a concatenation (or `${common.fixturesDir}/GH-7131` ) than path.posix.join
There was a problem hiding this comment.
@refack to be clear, you're saying that path.join() is wrong because it'll resolve to a\b on Windows, and require always takes a POSIX style path (a/b)?
Not wrong per se, just less right.
|
path.join() nits included, new CI: https://ci.nodejs.org/job/node-test-pull-request/9202/ |
I have to kill the ARM job https://ci.nodejs.org/job/node-test-binary-arm/9302/ It was Green (yellow) but wasn't reporting that it finished upstream. |
|
CI appears to be having some issues right now |
FWIW https://ci.nodejs.org/job/node-test-binary-arm/9302/ was green, except for a flake in freeBSD. And currently CI is even flakier then last night. |
@refack Are you saying that the whole run was green (except for a flake), not just the ARM machines? The node-test-binary-arm in the URL threw me off. |
Yes. Whole run was green. |
`module.children` is supposed to be the list of modules included by this module but lib/module.js failed to update the list when the included module was retrieved from `Module._cache`. Fixes: nodejs#7131 PR-URL: nodejs#14132 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
`module.children` is supposed to be the list of modules included by this module but lib/module.js failed to update the list when the included module was retrieved from `Module._cache`. Fixes: #7131 PR-URL: #14132 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
|
@bnoordhuis should this be backported to LTS? if so how far back? edit: considering this broke some stuff in the wild it might be best to just leave it out... at least of v4.x |
Matchmaker is now globally accessible under Ladders, rather than needing to be manually required. This fixes a crash when hotpatching certain things.
|
Confirming that this did break stuff at least for our project, which had to be dealt with using a global state-based quick&dirty fix. |
|
@nodejs/tsc |
|
ping @nodejs/tsc and @nodejs/lts one more time |
|
-1 in backporting |
|
It's breaking this too. because of this . https://github.com/krakenjs/freshy/blob/master/index.js#L85 |
module.childrenis supposed to be the list of modules included by thismodule but lib/module.js failed to update the list when the included
module was retrieved from
Module._cache.Fixes: #7131
CI: https://ci.nodejs.org/job/node-test-pull-request/9038/