Skip to content

Commit

Permalink
esm: fix typo parentUrl -> parentURL
Browse files Browse the repository at this point in the history
PR-URL: nodejs#48999
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
  • Loading branch information
aduh95 authored and UlisesGascon committed Aug 14, 2023
1 parent c57a67b commit 1156a73
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions lib/internal/modules/esm/initialize_import_meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions lib/internal/modules/esm/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class ModuleLoader {
* string, parentURL: string,
* importAssertions: Record<string, string>
* ) ResolveResult;
* register(specifier: string, parentUrl: string): any;
* register(specifier: string, parentURL: string): any;
* forceLoadHooks(): void;
* }
* ```
Expand Down Expand Up @@ -307,15 +307,15 @@ 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
// order to preserve the git diff instead of moving the class.
// eslint-disable-next-line no-use-before-define
this.setCustomizations(new CustomizedModuleLoader());
}
return this.#customizations.register(specifier, parentUrl);
return this.#customizations.register(specifier, parentURL);
}

/**
Expand Down

0 comments on commit 1156a73

Please sign in to comment.