From 05fda9e494f6c44849f29649191d28242f1a6baf Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 2 Aug 2023 18:05:22 +0200 Subject: [PATCH] esm: fix typo `parentUrl` -> `parentURL` --- lib/internal/modules/esm/initialize_import_meta.js | 10 +++++----- lib/internal/modules/esm/loader.js | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/internal/modules/esm/initialize_import_meta.js b/lib/internal/modules/esm/initialize_import_meta.js index 631231dd9ba7d5..010f4d1a858690 100644 --- a/lib/internal/modules/esm/initialize_import_meta.js +++ b/lib/internal/modules/esm/initialize_import_meta.js @@ -5,16 +5,16 @@ const experimentalImportMetaResolve = getOptionValue('--experimental-import-meta /** * Generate a function to be used as import.meta.resolve for a particular module. - * @param {string} defaultParentUrl The default base to use for resolution + * @param {string} defaultParentURL The default base to use for resolution * @param {typeof import('./loader.js').ModuleLoader} loader Reference to the current module loader - * @returns {(specifier: string, parentUrl?: string) => string} Function to assign to import.meta.resolve + * @returns {(specifier: string, parentURL?: string) => string} Function to assign to import.meta.resolve */ -function createImportMetaResolve(defaultParentUrl, loader) { - return function resolve(specifier, parentUrl = defaultParentUrl) { +function createImportMetaResolve(defaultParentURL, loader) { + return function resolve(specifier, parentURL = defaultParentURL) { let url; try { - ({ url } = loader.resolveSync(specifier, parentUrl)); + ({ url } = loader.resolveSync(specifier, parentURL)); } catch (error) { if (error?.code === 'ERR_UNSUPPORTED_DIR_IMPORT') { ({ url } = error); diff --git a/lib/internal/modules/esm/loader.js b/lib/internal/modules/esm/loader.js index 93ab847bf979d0..0224f624e1c210 100644 --- a/lib/internal/modules/esm/loader.js +++ b/lib/internal/modules/esm/loader.js @@ -152,7 +152,7 @@ class ModuleLoader { * string, parentURL: string, * importAssertions: Record * ) ResolveResult; - * register(specifier: string, parentUrl: string): any; + * register(specifier: string, parentURL: string): any; * forceLoadHooks(): void; * } * ``` @@ -307,7 +307,7 @@ class ModuleLoader { return module.getNamespace(); } - register(specifier, parentUrl) { + register(specifier, parentURL) { if (!this.#customizations) { // `CustomizedModuleLoader` is defined at the bottom of this file and // available well before this line is ever invoked. This is here in @@ -315,7 +315,7 @@ class ModuleLoader { // eslint-disable-next-line no-use-before-define this.setCustomizations(new CustomizedModuleLoader()); } - return this.#customizations.register(specifier, parentUrl); + return this.#customizations.register(specifier, parentURL); } /**