File tree 1 file changed +9
-2
lines changed
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -281,9 +281,16 @@ class ModuleConcatenationPlugin {
281
281
for ( const reason of newModule . reasons ) {
282
282
reason . dependency . module = newModule ;
283
283
}
284
- for ( const dep of newModule . dependencies ) {
284
+ // TODO: remove when LTS node version contains fixed v8 version
285
+ // @see https://github.com/webpack/webpack/pull/6613
286
+ // Turbofan does not correctly inline for-of loops with polymorphic input arrays.
287
+ // Work around issue by using a standard for loop and assigning dep.module.reasons
288
+ for ( let i = 0 ; i < newModule . dependencies . length ; i ++ ) {
289
+ let dep = newModule . dependencies [ i ] ;
285
290
if ( dep . module ) {
286
- for ( const reason of dep . module . reasons ) {
291
+ let reasons = dep . module . reasons ;
292
+ for ( let j = 0 ; j < reasons . length ; j ++ ) {
293
+ let reason = reasons [ j ] ;
287
294
if ( reason . dependency === dep ) reason . module = newModule ;
288
295
}
289
296
}
You can’t perform that action at this time.
0 commit comments