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

Commit 4e41a0c

Browse files
committed
fix attempt for #254
1 parent e439d57 commit 4e41a0c

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/loader.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,15 @@ function logloads(loads) {
342342
throw new TypeError('"' + name + '" already exists in the module table');
343343

344344
// adjusted to pick up existing loads
345-
for (var i = 0, l = loader.loads.length; i < l; i++)
346-
if (loader.loads[i].name == name)
347-
return resolve(loader.loads[i].linkSets[0].done);
345+
var existingLoad;
346+
for (var i = 0, l = loader.loads.length; i < l; i++) {
347+
if (loader.loads[i].name == name) {
348+
existingLoad = loader.loads[i];
349+
return existingLoad.linkSets[0].done.then(function() {
350+
resolve(existingLoad);
351+
});
352+
}
353+
}
348354

349355
var load = createLoad(name);
350356

0 commit comments

Comments
 (0)