Skip to content

Commit 5c65565

Browse files
authored
esm: fix typo parentUrl -> parentURL
PR-URL: #48999 Reviewed-By: Jacob Smith <jacob@frende.me> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
1 parent c58e8fc commit 5c65565

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

lib/internal/modules/esm/initialize_import_meta.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ const experimentalImportMetaResolve = getOptionValue('--experimental-import-meta
55

66
/**
77
* Generate a function to be used as import.meta.resolve for a particular module.
8-
* @param {string} defaultParentUrl The default base to use for resolution
8+
* @param {string} defaultParentURL The default base to use for resolution
99
* @param {typeof import('./loader.js').ModuleLoader} loader Reference to the current module loader
10-
* @returns {(specifier: string, parentUrl?: string) => string} Function to assign to import.meta.resolve
10+
* @returns {(specifier: string, parentURL?: string) => string} Function to assign to import.meta.resolve
1111
*/
12-
function createImportMetaResolve(defaultParentUrl, loader) {
13-
return function resolve(specifier, parentUrl = defaultParentUrl) {
12+
function createImportMetaResolve(defaultParentURL, loader) {
13+
return function resolve(specifier, parentURL = defaultParentURL) {
1414
let url;
1515

1616
try {
17-
({ url } = loader.resolveSync(specifier, parentUrl));
17+
({ url } = loader.resolveSync(specifier, parentURL));
1818
} catch (error) {
1919
if (error?.code === 'ERR_UNSUPPORTED_DIR_IMPORT') {
2020
({ url } = error);

lib/internal/modules/esm/loader.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ class ModuleLoader {
152152
* string, parentURL: string,
153153
* importAssertions: Record<string, string>
154154
* ) ResolveResult;
155-
* register(specifier: string, parentUrl: string): any;
155+
* register(specifier: string, parentURL: string): any;
156156
* forceLoadHooks(): void;
157157
* }
158158
* ```
@@ -307,15 +307,15 @@ class ModuleLoader {
307307
return module.getNamespace();
308308
}
309309

310-
register(specifier, parentUrl) {
310+
register(specifier, parentURL) {
311311
if (!this.#customizations) {
312312
// `CustomizedModuleLoader` is defined at the bottom of this file and
313313
// available well before this line is ever invoked. This is here in
314314
// order to preserve the git diff instead of moving the class.
315315
// eslint-disable-next-line no-use-before-define
316316
this.setCustomizations(new CustomizedModuleLoader());
317317
}
318-
return this.#customizations.register(specifier, parentUrl);
318+
return this.#customizations.register(specifier, parentURL);
319319
}
320320

321321
/**

0 commit comments

Comments
 (0)