Skip to content

Commit 4dbe06d

Browse files
committed
Get data from locate call
Instead of instantiate, which isn’t called when error is thrown from a module.
1 parent 47ef9f1 commit 4dbe06d

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

index.js

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,16 @@ System.normalize = function (path, importFrom) {
1212
});
1313
return promise;
1414
};
15-
var systemInstantiate = System.instantiate;
16-
System.instantiate = function (load) {
17-
return systemInstantiate.apply(this, arguments)
18-
.then(function (result) {
19-
var importData = imports[load.name];
20-
importData.metadata = load.metadata;
21-
var fromData = imports[importData.from];
22-
if (fromData) {
23-
fromData.deps.push(importData);
24-
}
25-
return result;
26-
});
15+
16+
var systemLocate = System.locate;
17+
System.locate = function (load) {
18+
var importData = imports[load.name];
19+
importData.metadata = load.metadata;
20+
var fromData = imports[importData.from];
21+
if (fromData) {
22+
fromData.deps.push(importData);
23+
}
24+
return systemLocate.apply(this, arguments);
2725
};
2826

2927
export function logImport (importData) {
@@ -34,7 +32,7 @@ export function logImport (importData) {
3432
if (metaKey === 'deps') continue;
3533
var metaValue = metadata[metaKey];
3634
if (metaValue !== undefined) {
37-
console.log(`${metaKey}:`,metaValue);
35+
console.log(`${metaKey}:`, metaValue);
3836
}
3937
}
4038
console.group(' deps: ', importData.deps.length);

0 commit comments

Comments
 (0)