This repository was archived by the owner on Jul 13, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +32
-8
lines changed Expand file tree Collapse file tree 5 files changed +32
-8
lines changed Original file line number Diff line number Diff line change @@ -3,3 +3,4 @@ bower_components
3
3
tmp
4
4
coverage
5
5
.DS_Store
6
+ * .sw ?
Original file line number Diff line number Diff line change @@ -516,14 +516,35 @@ function logloads(loads) {
516
516
517
517
// 15.2.5.2.4
518
518
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
+
519
531
var loader = linkSet . loader ;
532
+ var requests ;
520
533
521
534
if ( load ) {
522
- if ( load && linkSet . loads [ 0 ] . name != load . name )
523
- exc = addToError ( exc , 'Error loading ' + load . name + ' from ' + linkSet . loads [ 0 ] . name ) ;
524
-
525
- 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
+ }
544
+ }
545
+ else {
526
546
exc = addToError ( exc , 'Error loading ' + load . name ) ;
547
+ }
527
548
}
528
549
else {
529
550
exc = addToError ( exc , 'Error linking ' + linkSet . loads [ 0 ] . name ) ;
Original file line number Diff line number Diff line change 33
33
fulfill ( xhr . responseText ) ;
34
34
}
35
35
function error ( ) {
36
- reject ( xhr . statusText + ': ' + url || 'XHR error' ) ;
36
+ reject ( new Error ( xhr . statusText + ': ' + url || 'XHR error' ) ) ;
37
37
}
38
38
39
39
xhr . onreadystatechange = function ( ) {
68
68
else
69
69
url = url . substr ( 7 ) ;
70
70
return fs . readFile ( url , function ( err , data ) {
71
- if ( err )
71
+ if ( err ) {
72
72
return reject ( err ) ;
73
- else {
73
+ } else {
74
74
// Strip Byte Order Mark out if it's the leading char
75
75
var dataString = data + '' ;
76
76
if ( dataString [ 0 ] === '\ufeff' )
89
89
return new Promise ( function ( resolve , reject ) {
90
90
fetchTextFromURL ( load . address , resolve , reject ) ;
91
91
} ) ;
92
- } ;
92
+ } ;
Original file line number Diff line number Diff line change
1
+ import './load-non-existent.js' ;
Original file line number Diff line number Diff line change
1
+ export { nothing } from 'nosuchfile.js' ;
You can’t perform that action at this time.
0 commit comments