1
- import { Loader , Module , } from './loader-polyfill.js' ;
1
+ import { Loader , ModuleNamespace } from './loader-polyfill.js' ;
2
2
import { resolveIfNotPlain } from './resolve.js' ;
3
3
import { addToError , global , createSymbol , baseURI } from './common.js' ;
4
4
@@ -122,7 +122,7 @@ RegisterLoader.prototype[Loader.resolveInstantiate] = function (key, parentKey)
122
122
123
123
return resolveInstantiate ( loader , key , parentKey , registry , registerRegistry )
124
124
. then ( function ( instantiated ) {
125
- if ( instantiated instanceof Module )
125
+ if ( instantiated instanceof ModuleNamespace )
126
126
return instantiated ;
127
127
128
128
// if already beaten to linked, return
@@ -205,7 +205,7 @@ function instantiate (loader, load, link, registry, registerRegistry) {
205
205
. then ( function ( instantiation ) {
206
206
// direct module return from instantiate -> we're done
207
207
if ( instantiation !== undefined ) {
208
- if ( ! ( instantiation instanceof Module ) )
208
+ if ( ! ( instantiation instanceof ModuleNamespace ) )
209
209
throw new TypeError ( 'Instantiate did not return a valid Module object.' ) ;
210
210
211
211
delete registerRegistry [ load . key ] ;
@@ -407,7 +407,7 @@ function instantiateDeps (loader, load, link, registry, registerRegistry, seen)
407
407
if ( setter ) {
408
408
var instantiation = dependencyInstantiations [ i ] ;
409
409
410
- if ( instantiation instanceof Module ) {
410
+ if ( instantiation instanceof ModuleNamespace ) {
411
411
setter ( instantiation ) ;
412
412
}
413
413
else {
@@ -474,7 +474,7 @@ function clearLoadErrors (loader, load) {
474
474
475
475
if ( link . dependencyInstantiations )
476
476
link . dependencyInstantiations . forEach ( function ( depLoad , index ) {
477
- if ( ! depLoad || depLoad instanceof Module )
477
+ if ( ! depLoad || depLoad instanceof ModuleNamespace )
478
478
return ;
479
479
480
480
if ( depLoad . linkRecord ) {
@@ -588,7 +588,7 @@ function makeDynamicRequire (loader, key, dependencies, dependencyInstantiations
588
588
var depLoad = dependencyInstantiations [ i ] ;
589
589
var module ;
590
590
591
- if ( depLoad instanceof Module )
591
+ if ( depLoad instanceof ModuleNamespace )
592
592
module = depLoad ;
593
593
else
594
594
module = ensureEvaluate ( loader , depLoad , depLoad . linkRecord , registry , registerRegistry , seen ) ;
@@ -614,7 +614,7 @@ function doEvaluate (loader, load, link, registry, registerRegistry, seen) {
614
614
for ( var i = 0 ; i < link . dependencies . length ; i ++ ) {
615
615
depLoad = link . dependencyInstantiations [ i ] ;
616
616
617
- if ( depLoad instanceof Module )
617
+ if ( depLoad instanceof ModuleNamespace )
618
618
continue ;
619
619
620
620
// custom Module returned from instantiate
@@ -669,7 +669,7 @@ function doEvaluate (loader, load, link, registry, registerRegistry, seen) {
669
669
if ( err )
670
670
return link . error = addToError ( err , 'Evaluating ' + load . key ) ;
671
671
672
- registry [ load . key ] = load . module = new Module ( link . moduleObj ) ;
672
+ registry [ load . key ] = load . module = new ModuleNamespace ( link . moduleObj ) ;
673
673
674
674
// if not an esm module, run importer setters and clear them
675
675
// this allows dynamic modules to update themselves into es modules
0 commit comments