Skip to content
This repository was archived by the owner on Jul 13, 2020. It is now read-only.

Commit 54b98bf

Browse files
committed
ensure errors are only cached on original record not through stack
1 parent 30d9a72 commit 54b98bf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

core/register-loader.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,8 @@ function instantiateDeps (loader, load, link, registry, state, seen) {
386386
setter(instantiation);
387387
}
388388
else {
389+
if (instantiation.loadError)
390+
throw instantiation.loadError;
389391
setter(instantiation.module || instantiation.linkRecord.moduleObj);
390392
// this applies to both es and dynamic registrations
391393
if (instantiation.importerSetters)
@@ -431,8 +433,8 @@ function instantiateDeps (loader, load, link, registry, state, seen) {
431433
})
432434
.catch(function (err) {
433435
// throw up the instantiateDeps stack
434-
load.linkRecord = undefined;
435-
throw load.loadError = load.loadError || addToError(err, 'Loading ' + load.key);
436+
link.depsInstantiatePromise = undefined;
437+
throw addToError(err, 'Loading ' + load.key);
436438
});
437439
}
438440

0 commit comments

Comments
 (0)