Skip to content

Commit 4c69156

Browse files
committed
fixed webpack#1769
1 parent f5533c1 commit 4c69156

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

lib/ContextModule.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ ContextModule.prototype.source = function() {
149149
"function webpackAsyncContext(req) {\n",
150150
"\tvar ids = map[req];",
151151
"\tif(!ids)\n",
152-
"\t\tthrow new Error(\"Cannot find module '\" + req + \"'.\");\n",
152+
"\t\treturn Promise.reject(new Error(\"Cannot find module '\" + req + \"'.\"));\n",
153153
"\treturn ",
154154
hasMultipleChunks ?
155155
"Promise.all(ids.slice(1).map(__webpack_require__.e))" :

test/cases/context/issue-1769/folder/0.js

Whitespace-only changes.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
it("should be able the catch a incorrect System.import", function(done) {
2+
var expr = "1";
3+
System.import("./folder/" + expr).then(function() {
4+
done(new Error("should not be called"));
5+
}).catch(function(err) {
6+
err.should.be.instanceof(Error);
7+
done();
8+
});
9+
});

0 commit comments

Comments
 (0)