@@ -67,7 +67,9 @@ class JsonpMainTemplatePlugin {
6767 "var chunk = installedChunks[chunkId];" ,
6868 "if(chunk !== 0) {" ,
6969 this . indent ( [
70- "if(chunk) chunk[1](new Error('Loading chunk ' + chunkId + ' failed.'));" ,
70+ "if(chunk) {" ,
71+ this . indent ( "chunk[1](new Error('Loading chunk ' + chunkId + ' failed.'));" ) ,
72+ "}" ,
7173 "installedChunks[chunkId] = undefined;"
7274 ] ) ,
7375 "}"
@@ -77,10 +79,11 @@ class JsonpMainTemplatePlugin {
7779 } ) ;
7880 mainTemplate . plugin ( "require-ensure" , function ( _ , chunk , hash ) {
7981 return this . asString ( [
80- "if(installedChunks[chunkId] === 0)" ,
82+ "if(installedChunks[chunkId] === 0) { " ,
8183 this . indent ( [
8284 "return Promise.resolve();"
8385 ] ) ,
86+ "}" ,
8487 "" ,
8588 "// a Promise means \"currently loading\"." ,
8689 "if(installedChunks[chunkId]) {" ,
@@ -131,8 +134,9 @@ class JsonpMainTemplatePlugin {
131134 "for(;i < chunkIds.length; i++) {" ,
132135 this . indent ( [
133136 "chunkId = chunkIds[i];" ,
134- "if(installedChunks[chunkId])" ,
137+ "if(installedChunks[chunkId]) { " ,
135138 this . indent ( "resolves.push(installedChunks[chunkId][0]);" ) ,
139+ "}" ,
136140 "installedChunks[chunkId] = 0;"
137141 ] ) ,
138142 "}" ,
@@ -144,8 +148,9 @@ class JsonpMainTemplatePlugin {
144148 ] ) ,
145149 "}" ,
146150 "if(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);" ,
147- "while(resolves.length)" ,
151+ "while(resolves.length) { " ,
148152 this . indent ( "resolves.shift()();" ) ,
153+ "}" ,
149154 this . entryPointInChildren ( chunk ) ? [
150155 "if(executeModules) {" ,
151156 this . indent ( [
0 commit comments