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

Commit

Permalink
fix race conditions (systemjs/systemjs#644)
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Aug 2, 2015
1 parent fdb52e8 commit e36fa26
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,9 @@ function logloads(loads) {
}
// 15.2.5.2.2
function addLoadToLinkSet(linkSet, load) {
if (load.status == 'failed')
return;

console.assert(load.status == 'loading' || load.status == 'loaded', 'loading or loaded on link set');

for (var i = 0, l = linkSet.loads.length; i < l; i++)
Expand All @@ -434,6 +437,9 @@ function logloads(loads) {
var loader = linkSet.loader;

for (var i = 0, l = load.dependencies.length; i < l; i++) {
if (!load.dependencies[i])
continue;

var name = load.dependencies[i].value;

if (loader.modules[name])
Expand Down

0 comments on commit e36fa26

Please sign in to comment.