Skip to content

Commit 99865a7

Browse files
committed
fixup! module: fix conditions override in synchronous resolve hooks
1 parent 4f8c7b0 commit 99865a7

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

β€Žlib/internal/modules/cjs/loader.jsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1320,7 +1320,7 @@ Module._load = function(request, parent, isMain) {
13201320
* @param {ResolveFilenameOptions} options Options object
13211321
* @typedef {object} ResolveFilenameOptions
13221322
* @property {string[]} paths Paths to search for modules in
1323-
* @param {Set<string>} conditions The conditions to use for resolution.
1323+
* @property {Set<string>?} conditions The conditions to use for resolution.
13241324
* @returns {void|string}
13251325
*/
13261326
Module._resolveFilename = function(request, parent, isMain, options) {

β€Žlib/internal/modules/esm/loader.jsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ class ModuleLoader {
761761
* from module.register() which are run in a blocking fashion for it to be synchronous.
762762
* @param {string|URL} specifier See {@link resolveSync}.
763763
* @param {{ parentURL?: string, importAttributes: ImportAttributes, conditions?: string[]}} context
764-
* See {@link resolveSync}.
764+
* See {@link resolveSync}.
765765
* @returns {{ format: string, url: string }}
766766
*/
767767
#resolveAndMaybeBlockOnLoaderThread(specifier, context) {

β€Žtest/module-hooks/test-module-hooks-custom-conditions-cjs.jsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ const { cjs, esm } = require('../fixtures/es-modules/custom-condition/load.cjs')
5454
assert.strictEqual((await esm('foo/fourth')).result, 'foo');
5555
hooks.deregister();
5656
}
57-
})().catch(common.mustNotCall());
57+
})().then(common.mustCall());

β€Žtest/module-hooks/test-module-hooks-custom-conditions-special-values.jsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ const { cjs, esm } = require('../fixtures/es-modules/custom-condition/load.cjs')
6767
});
6868
hooks.deregister();
6969
}
70-
})().catch(common.mustNotCall());
70+
})().then(common.mustCall());

0 commit comments

Comments
Β (0)