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

Commit 64a5d70

Browse files
committed
ie8 compat and adjustments, remove unused tests
1 parent 3201bb4 commit 64a5d70

File tree

4 files changed

+16
-25
lines changed

4 files changed

+16
-25
lines changed

src/loader.js

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -516,34 +516,26 @@ function logloads(loads) {
516516

517517
// 15.2.5.2.4
518518
function linkSetFailed(linkSet, load, exc) {
519-
function requestsForLoad() {
520-
var reqs = [];
521-
linkSet.loads.forEach(function(aLoad){
522-
aLoad.dependencies.forEach(function(dep){
523-
if (dep.value == load.name) {
524-
reqs.push({as: dep.key, from: aLoad.name});
525-
}
526-
});
527-
});
528-
return reqs;
529-
}
530-
531519
var loader = linkSet.loader;
532520
var requests;
533521

522+
checkError:
534523
if (load) {
535-
if (linkSet.loads[0].name != load.name) {
536-
requests = requestsForLoad();
537-
538-
if (requests[0]) {
539-
var req = requests[0];
540-
exc = addToError(exc, 'Error loading ' + load.name + ' as "' + req.as + '" from ' + req.from);
541-
} else {
542-
exc = addToError(exc, 'Error loading ' + load.name + ' from ' + linkSet.loads[0].name);
543-
}
524+
if (linkSet.loads[0].name == load.name) {
525+
exc = addToError(exc, 'Error loading ' + load.name);
544526
}
545527
else {
546-
exc = addToError(exc, 'Error loading ' + load.name);
528+
for (var i = 0; i < linkSet.loads.length; i++) {
529+
var pLoad = linkSet.loads[i];
530+
for (var j = 0; j < pLoad.dependencies.length; j++) {
531+
var dep = pLoad.dependencies[j];
532+
if (dep.value == load.name) {
533+
exc = addToError(exc, 'Error loading ' + load.name + ' as "' + dep.key + '" from ' + pLoad.name);
534+
break checkError;
535+
}
536+
}
537+
}
538+
exc = addToError(exc, 'Error loading ' + load.name + ' from ' + linkSet.loads[0].name);
547539
}
548540
}
549541
else {

src/system-fetch.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@
7070
return fs.readFile(url, function(err, data) {
7171
if (err) {
7272
return reject(err);
73-
} else {
73+
}
74+
else {
7475
// Strip Byte Order Mark out if it's the leading char
7576
var dataString = data + '';
7677
if (dataString[0] === '\ufeff')

test/loads/indirect-load.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/loads/noent.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)