es-module-loader
Advanced tools
Comparing version 2.2.1 to 2.2.2
import { addToError, createSymbol } from './common.js'; | ||
export { Loader, ModuleNamespace } | ||
export { Loader, ModuleNamespace, REGISTRY } | ||
@@ -139,3 +139,2 @@ var resolvedPromise = Promise.resolve(); | ||
this[REGISTRY] = {}; | ||
this._registry = REGISTRY; | ||
} | ||
@@ -142,0 +141,0 @@ // 4.4.1 |
@@ -1,2 +0,2 @@ | ||
import { Loader, ModuleNamespace } from './loader-polyfill.js'; | ||
import { Loader, ModuleNamespace, REGISTRY } from './loader-polyfill.js'; | ||
import { resolveIfNotPlain } from './resolve.js'; | ||
@@ -119,3 +119,3 @@ import { addToError, global, createSymbol, baseURI } from './common.js'; | ||
var state = this[REGISTER_INTERNAL]; | ||
var registry = loader.registry[loader.registry._registry]; | ||
var registry = this.registry[REGISTRY]; | ||
@@ -127,7 +127,12 @@ return resolveInstantiate(loader, key, parentKey, registry, state) | ||
// if already beaten to linked, return | ||
if (instantiated.module) | ||
return instantiated.module; | ||
// resolveInstantiate always returns a load record with a link record and no module value | ||
let link = instantiated.linkRecord; | ||
// resolveInstantiate always returns a load record with a link record and no module value | ||
// if already beaten to done, return | ||
if (!link) { | ||
if (instantiated.module) | ||
return instantiated.module; | ||
throw instantiated.evalError; | ||
} | ||
if (instantiated.linkRecord.linked) | ||
@@ -153,4 +158,7 @@ return ensureEvaluate(loader, instantiated, instantiated.linkRecord, registry, state, undefined); | ||
// already linked but not in main registry is ignored | ||
if (load && !load.module) | ||
if (load && !load.module) { | ||
if (load.loadError) | ||
return Promise.reject(load.loadError); | ||
return instantiate(loader, load, load.linkRecord, registry, state); | ||
} | ||
@@ -173,2 +181,5 @@ return loader.resolve(key, parentKey) | ||
if (load.loadError) | ||
return Promise.reject(load.loadError); | ||
var link = load.linkRecord; | ||
@@ -293,2 +304,5 @@ if (!link) | ||
if (load && load.loadError) | ||
throw load.loadError; | ||
// already has a module value but not already in the registry (load.module) | ||
@@ -409,5 +423,2 @@ // means it was removed by registry.delete, so we should | ||
if (depLoad.loadError) | ||
throw depLoad.loadError; | ||
if (!depLink || depLink.linked) | ||
@@ -414,0 +425,0 @@ continue; |
{ | ||
"name": "es-module-loader", | ||
"description": "An ES Module Loader shim", | ||
"version": "2.2.1", | ||
"version": "2.2.2", | ||
"homepage": "https://github.com/ModuleLoader/es-module-loader", | ||
@@ -6,0 +6,0 @@ "author": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
264145
8785