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

Commit ce86fa5

Browse files
crisptrutskiguybedford
authored andcommitted
Fix error reporting bug
1 parent 9e9467c commit ce86fa5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/loader.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
function Module() {}
2222
function Loader(options) {
2323
options = options || {};
24-
24+
2525
if (options.normalize)
2626
this.normalize = options.normalize;
2727
if (options.locate)
@@ -55,7 +55,7 @@ function Loader(options) {
5555
}
5656

5757
(function() {
58-
58+
5959
// Some Helpers
6060

6161
// logs a linkset snapshot for debugging
@@ -281,7 +281,7 @@ function logloads(loads) {
281281
// store the deps as load.deps
282282
load.declare = declare;
283283
load.depsList = deps;
284-
}
284+
}
285285
// empty {} context is closest to undefined 'this' we can get
286286
__eval(transpiled, load.address, {});
287287
curSystem.register = curRegister;
@@ -535,10 +535,11 @@ function logloads(loads) {
535535
var loader = linkSet.loader;
536536

537537
if (load) {
538-
if (linkSet.loads[0].name != load.name)
538+
if (load && linkSet.loads[0].name != load.name)
539539
exc = addToError(exc, 'Error loading "' + load.name + '" from "' + linkSet.loads[0].name + '" at ' + (linkSet.loads[0].address || '<unknown>'));
540540

541-
exc = addToError(exc, 'Error loading "' + load.name + '" at ' + (load.address || '<unknown>'));
541+
if (load)
542+
exc = addToError(exc, 'Error loading "' + load.name + '" at ' + (load.address || '<unknown>'));
542543
}
543544
else {
544545
exc = addToError(exc, 'Error linking "' + linkSet.loads[0].name + '" at ' + (linkSet.loads[0].address || '<unknwon>'));

0 commit comments

Comments
 (0)