@@ -321,14 +321,14 @@ class ESMLoader {
321
321
* @param {string } specifier The string after `from` in an `import` statement,
322
322
* or the first parameter of an `import()`
323
323
* expression
324
- * @param {string | undefined } parentURL The URL of the module importing this
324
+ * @param {string | undefined } parentUrl The URL of the module importing this
325
325
* one, unless this is the Node.js entry
326
326
* point.
327
327
* @param {Record<string, string> } importAssertions Validations for the
328
328
* module import.
329
329
* @returns {Promise<ModuleJob> } The (possibly pending) module job
330
330
*/
331
- async getModuleJob ( specifier , parentURL , importAssertions ) {
331
+ async getModuleJob ( specifier , parentUrl , importAssertions ) {
332
332
let importAssertionsForResolve ;
333
333
334
334
// By default, `this.#loaders` contains just the Node default load hook
@@ -342,7 +342,7 @@ class ESMLoader {
342
342
}
343
343
344
344
const { format, url } =
345
- await this . resolve ( specifier , parentURL , importAssertionsForResolve ) ;
345
+ await this . resolve ( specifier , parentUrl , importAssertionsForResolve ) ;
346
346
347
347
let job = this . moduleMap . get ( url , importAssertions . type ) ;
348
348
@@ -352,7 +352,7 @@ class ESMLoader {
352
352
}
353
353
354
354
if ( job === undefined ) {
355
- job = this . #createModuleJob( url , importAssertions , parentURL , format ) ;
355
+ job = this . #createModuleJob( url , importAssertions , parentUrl , format ) ;
356
356
}
357
357
358
358
return job ;
@@ -363,17 +363,17 @@ class ESMLoader {
363
363
* @param {string } url The absolute URL that was resolved for this module
364
364
* @param {Record<string, string> } importAssertions Validations for the
365
365
* module import.
366
- * @param {string } [parentURL ] The absolute URL of the module importing this
366
+ * @param {string } [parentUrl ] The absolute URL of the module importing this
367
367
* one, unless this is the Node.js entry point
368
368
* @param {string } [format] The format hint possibly returned by the
369
369
* `resolve` hook
370
370
* @returns {Promise<ModuleJob> } The (possibly pending) module job
371
371
*/
372
- #createModuleJob( url , importAssertions , parentURL , format ) {
372
+ #createModuleJob( url , importAssertions , parentUrl , format ) {
373
373
const moduleProvider = async ( url , isMain ) => {
374
374
const {
375
375
format : finalFormat ,
376
- responseURL ,
376
+ responseUrl ,
377
377
source,
378
378
} = await this . load ( url , {
379
379
format,
@@ -383,14 +383,14 @@ class ESMLoader {
383
383
const translator = translators . get ( finalFormat ) ;
384
384
385
385
if ( ! translator ) {
386
- throw new ERR_UNKNOWN_MODULE_FORMAT ( finalFormat , responseURL ) ;
386
+ throw new ERR_UNKNOWN_MODULE_FORMAT ( finalFormat , responseUrl ) ;
387
387
}
388
388
389
- return FunctionPrototypeCall ( translator , this , responseURL , source , isMain ) ;
389
+ return FunctionPrototypeCall ( translator , this , responseUrl , source , isMain ) ;
390
390
} ;
391
391
392
392
const inspectBrk = (
393
- parentURL === undefined &&
393
+ parentUrl === undefined &&
394
394
getOptionValue ( '--inspect-brk' )
395
395
) ;
396
396
@@ -399,7 +399,7 @@ class ESMLoader {
399
399
url ,
400
400
importAssertions ,
401
401
moduleProvider ,
402
- parentURL === undefined ,
402
+ parentUrl === undefined ,
403
403
inspectBrk
404
404
) ;
405
405
@@ -416,14 +416,14 @@ class ESMLoader {
416
416
* loader module.
417
417
*
418
418
* @param {string | string[] } specifiers Path(s) to the module.
419
- * @param {string } parentURL Path of the parent importing the module.
419
+ * @param {string } parentUrl Path of the parent importing the module.
420
420
* @param {Record<string, string> } importAssertions Validations for the
421
421
* module import.
422
422
* @returns {Promise<ExportedHooks | KeyedExports[]> }
423
423
* A collection of module export(s) or a list of collections of module
424
424
* export(s).
425
425
*/
426
- async import ( specifiers , parentURL , importAssertions ) {
426
+ async import ( specifiers , parentUrl , importAssertions ) {
427
427
// For loaders, `import` is passed multiple things to process, it returns a
428
428
// list pairing the url and exports collected. This is especially useful for
429
429
// error messaging, to identity from where an export came. But, in most
@@ -439,7 +439,7 @@ class ESMLoader {
439
439
const jobs = new Array ( count ) ;
440
440
441
441
for ( let i = 0 ; i < count ; i ++ ) {
442
- jobs [ i ] = this . getModuleJob ( specifiers [ i ] , parentURL , importAssertions )
442
+ jobs [ i ] = this . getModuleJob ( specifiers [ i ] , parentUrl , importAssertions )
443
443
. then ( ( job ) => job . run ( ) )
444
444
. then ( ( { module } ) => module . getNamespace ( ) ) ;
445
445
}
@@ -550,27 +550,27 @@ class ESMLoader {
550
550
format,
551
551
source,
552
552
} = loaded ;
553
- let responseURL = loaded . responseURL ;
553
+ let responseUrl = loaded . responseUrl ;
554
554
555
- if ( responseURL === undefined ) {
556
- responseURL = url ;
555
+ if ( responseUrl === undefined ) {
556
+ responseUrl = url ;
557
557
}
558
558
559
- let responseURLObj ;
560
- if ( typeof responseURL === 'string' ) {
559
+ let responseURL ;
560
+ if ( typeof responseUrl === 'string' ) {
561
561
try {
562
- responseURLObj = new URL ( responseURL ) ;
562
+ responseURL = new URL ( responseUrl ) ;
563
563
} catch {
564
- // responseURLObj not defined will throw in next branch.
564
+ // responseURL not defined will throw in next branch.
565
565
}
566
566
}
567
567
568
- if ( responseURLObj ?. href !== responseURL ) {
568
+ if ( responseURL ?. href !== responseUrl ) {
569
569
throw new ERR_INVALID_RETURN_PROPERTY_VALUE (
570
570
'undefined or a fully resolved URL string' ,
571
571
hookErrIdentifier ,
572
- 'responseURL ' ,
573
- responseURL ,
572
+ 'responseUrl ' ,
573
+ responseUrl ,
574
574
) ;
575
575
}
576
576
@@ -610,7 +610,7 @@ class ESMLoader {
610
610
611
611
return {
612
612
format,
613
- responseURL ,
613
+ responseUrl ,
614
614
source,
615
615
} ;
616
616
}
@@ -713,27 +713,27 @@ class ESMLoader {
713
713
*
714
714
* @param {string } originalSpecifier The specified URL path of the module to
715
715
* be resolved.
716
- * @param {string } [parentURL ] The URL path of the module's parent.
716
+ * @param {string } [parentUrl ] The URL path of the module's parent.
717
717
* @param {ImportAssertions } [importAssertions] Assertions from the import
718
718
* statement or expression.
719
719
* @returns {{ format: string, url: URL['href'] } }
720
720
*/
721
721
async resolve (
722
722
originalSpecifier ,
723
- parentURL ,
723
+ parentUrl ,
724
724
importAssertions = ObjectCreate ( null )
725
725
) {
726
- const isMain = parentURL === undefined ;
726
+ const isMain = parentUrl === undefined ;
727
727
728
728
if (
729
729
! isMain &&
730
- typeof parentURL !== 'string' &&
731
- ! isURLInstance ( parentURL )
730
+ typeof parentUrl !== 'string' &&
731
+ ! isURLInstance ( parentUrl )
732
732
) {
733
733
throw new ERR_INVALID_ARG_TYPE (
734
- 'parentURL ' ,
734
+ 'parentUrl ' ,
735
735
[ 'string' , 'URL' ] ,
736
- parentURL ,
736
+ parentUrl ,
737
737
) ;
738
738
}
739
739
const resolvers = this . #resolvers;
@@ -749,7 +749,7 @@ class ESMLoader {
749
749
const context = {
750
750
conditions : DEFAULT_CONDITIONS ,
751
751
importAssertions,
752
- parentURL ,
752
+ parentUrl ,
753
753
} ;
754
754
755
755
const nextResolve = async ( suppliedSpecifier , ctx = context ) => {
0 commit comments