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

Commit b4af2d4

Browse files
committed
update loaded condition check (ES bug 2602)
1 parent f9b7c0c commit b4af2d4

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

lib/loader.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,7 @@ function logloads(loads) {
151151
load = createLoad(name);
152152
loader.loads.push(load);
153153

154-
setTimeout(function() {
155-
proceedToLocate(loader, load);
156-
}, 7);
154+
proceedToLocate(loader, load);
157155

158156
return load;
159157
});
@@ -176,7 +174,7 @@ function logloads(loads) {
176174
p
177175
// 15.2.4.4.1 CallFetch
178176
.then(function(address) {
179-
if (load.linkSets.length == 0)
177+
if (load.status != 'loading')
180178
return;
181179
load.address = address;
182180

@@ -190,22 +188,22 @@ function logloads(loads) {
190188
p
191189
// 15.2.4.5.1 CallTranslate
192190
.then(function(source) {
193-
if (load.linkSets.length == 0)
191+
if (load.status != 'loading')
194192
return;
195193
return loader.loaderObj.translate({ name: load.name, metadata: load.metadata, address: load.address, source: source });
196194
})
197195

198196
// 15.2.4.5.2 CallInstantiate
199197
.then(function(source) {
200-
if (load.linkSets.length == 0)
198+
if (load.status != 'loading')
201199
return;
202200
load.source = source;
203201
return loader.loaderObj.instantiate({ name: load.name, metadata: load.metadata, address: load.address, source: source });
204202
})
205203

206204
// 15.2.4.5.3 InstantiateSucceeded
207205
.then(function(instantiateResult) {
208-
if (load.linkSets.length == 0)
206+
if (load.status != 'loading')
209207
return;
210208

211209
var depsList;

0 commit comments

Comments
 (0)