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

Commit c518b8c

Browse files
committed
fix linking bug systemjs/systemjs#656
1 parent c48539c commit c518b8c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/loader.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -371,13 +371,15 @@ function logloads(loads) {
371371
proceedToTranslate(loader, existingLoad, Promise.resolve(stepState.moduleSource));
372372
}
373373

374-
return existingLoad.linkSets[0].done.then(function() {
375-
resolve(existingLoad);
376-
});
374+
// a primary load -> use that existing linkset
375+
if (existingLoad.linkSets.length)
376+
return existingLoad.linkSets[0].done.then(function() {
377+
resolve(existingLoad);
378+
});
377379
}
378380
}
379381

380-
var load = createLoad(name);
382+
var load = existingLoad || createLoad(name);
381383

382384
load.metadata = stepState.moduleMetadata;
383385

0 commit comments

Comments
 (0)