Skip to content

Commit

Permalink
6.8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
joeldenning committed Dec 31, 2020
1 parent 5b99ee2 commit 895ebaf
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 28 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
SystemJS 6.8.3
* Allow deletion of uninstantiated modules whose top level parent import finished. (https://github.com/systemjs/systemjs/pull/2291)

SystemJS 6.8.2
* Fix deleting modules after link failure. (https://github.com/systemjs/systemjs/pull/2288)
* Ensure onload hooks retain catches (https://github.com/systemjs/systemjs/pull/2289)
Expand Down
17 changes: 10 additions & 7 deletions dist/s.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SJS 6.8.2
* SJS 6.8.3
* Minimal SystemJS Build
*/
(function () {
Expand Down Expand Up @@ -373,8 +373,6 @@
// dependency load records
d: undefined,
// execution function
// set to NULL immediately after execution (or on any failure) to indicate execution has happened
// in such a case, C should be used, and E, I, L will be emptied
e: undefined,

// On execution we have populated:
Expand All @@ -386,18 +384,23 @@
// On execution, L, I, E cleared

// Promise for top-level completion
C: undefined
C: undefined,

// parent instantiator / executor
p: undefined
};
}

function instantiateAll (loader, load, loaded) {
function instantiateAll (loader, load, parent, loaded) {
if (!loaded[load.id]) {
loaded[load.id] = true;
// load.L may be undefined for already-instantiated
return Promise.resolve(load.L)
.then(function () {
if (!load.p || load.p.e === null)
load.p = parent;
return Promise.all(load.d.map(function (dep) {
return instantiateAll(loader, dep, loaded);
return instantiateAll(loader, dep, parent, loaded);
}));
})
.catch(function (err) {
Expand All @@ -410,7 +413,7 @@
}

function topLevelLoad (loader, load) {
return load.C = instantiateAll(loader, load, {})
return load.C = instantiateAll(loader, load, load, {})
.then(function () {
return postOrderExec(loader, load, {});
})
Expand Down
2 changes: 1 addition & 1 deletion dist/s.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/s.min.js.map

Large diffs are not rendered by default.

17 changes: 10 additions & 7 deletions dist/system-node.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2825,8 +2825,6 @@ function getOrCreateLoad (loader, id, firstParentUrl) {
// dependency load records
d: undefined,
// execution function
// set to NULL immediately after execution (or on any failure) to indicate execution has happened
// in such a case, C should be used, and E, I, L will be emptied
e: undefined,

// On execution we have populated:
Expand All @@ -2838,18 +2836,23 @@ function getOrCreateLoad (loader, id, firstParentUrl) {
// On execution, L, I, E cleared

// Promise for top-level completion
C: undefined
C: undefined,

// parent instantiator / executor
p: undefined
};
}

function instantiateAll (loader, load, loaded) {
function instantiateAll (loader, load, parent, loaded) {
if (!loaded[load.id]) {
loaded[load.id] = true;
// load.L may be undefined for already-instantiated
return Promise.resolve(load.L)
.then(function () {
if (!load.p || load.p.e === null)
load.p = parent;
return Promise.all(load.d.map(function (dep) {
return instantiateAll(loader, dep, loaded);
return instantiateAll(loader, dep, parent, loaded);
}));
})
.catch(function (err) {
Expand All @@ -2863,7 +2866,7 @@ function instantiateAll (loader, load, loaded) {
}

function topLevelLoad (loader, load) {
return load.C = instantiateAll(loader, load, {})
return load.C = instantiateAll(loader, load, load, {})
.then(function () {
return postOrderExec(loader, load, {});
})
Expand Down Expand Up @@ -3105,7 +3108,7 @@ systemJSPrototype.delete = function (id) {
var load = registry[id];
// in future we can support load.E case by failing load first
// but that will require TLA callbacks to be implemented
if (!load || load.e !== null || load.E)
if (!load || (load.p && load.p.e !== null) || load.E)
return false;

var importerSetters = load.i;
Expand Down

0 comments on commit 895ebaf

Please sign in to comment.