Skip to content

Commit 7747251

Browse files
committed
fixes webpack#2603
1 parent 2343af4 commit 7747251

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

‎lib/JsonpMainTemplatePlugin.js‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ JsonpMainTemplatePlugin.prototype.apply = function(mainTemplate) {
125125
this.indent([
126126
"// add \"moreModules\" to the modules object,",
127127
"// then flag all \"chunkIds\" as loaded and fire callback",
128-
"var moduleId, chunkId, i = 0, resolves = [];",
128+
"var moduleId, chunkId, i = 0, resolves = [], result;",
129129
"for(;i < chunkIds.length; i++) {",
130130
this.indent([
131131
"chunkId = chunkIds[i];",
@@ -146,14 +146,12 @@ JsonpMainTemplatePlugin.prototype.apply = function(mainTemplate) {
146146
this.entryPointInChildren(chunk) ? [
147147
"if(executeModules) {",
148148
this.indent([
149-
"for(moduleId in executeModules) {",
150-
this.indent([
151-
"if(Object.prototype.hasOwnProperty.call(executeModules, moduleId))",
152-
this.indent("return " + this.requireFn + "(moduleId);")
153-
]),
149+
"for(i=0; i < executeModules.length; i++) {",
150+
this.indent("result = " + this.requireFn + "(executeModules[i]);"),
154151
"}"
155152
]),
156-
"}"
153+
"}",
154+
"return result;",
157155
] : ""
158156
]),
159157
"};"

0 commit comments

Comments
 (0)