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

Commit 9d5c7b1

Browse files
committed
ensure unhandled rejections warning
1 parent da25cfa commit 9d5c7b1

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/loader.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -862,14 +862,13 @@ function logloads(loads) {
862862
// importPromises adds ability to import a module twice without error - https://bugs.ecmascript.org/show_bug.cgi?id=2601
863863
function createImportPromise(loader, name, promise) {
864864
var importPromises = loader._loader.importPromises;
865-
importPromises[name] = promise;
866-
promise.then(function() {
865+
return importPromises[name] = promise.then(function(m) {
867866
importPromises[name] = undefined;
868-
});
869-
promise['catch'](function() {
867+
return m;
868+
}, function(e) {
870869
importPromises[name] = undefined;
870+
throw e;
871871
});
872-
return promise;
873872
}
874873

875874
Loader.prototype = {

0 commit comments

Comments
 (0)