Minification of for..of loop replaces the loop variable and iterable object variable with the same names, which is syntactically incorrect and throws Uncaught ReferenceError: can't access lexical declaration 'n' before initialization.
Steps to recreate
Consider the following code block:
function forEachTest() {
const arr = [1, 2, 3];
arr.push(4);
for (const num of arr) {
console.log(num);
}
}
Installed product versions
Description
Minification of for..of loop replaces the loop variable and iterable object variable with the same names, which is syntactically incorrect and throws
Uncaught ReferenceError: can't access lexical declaration 'n' before initialization
.Steps to recreate
Consider the following code block:
With following
bundleconfig.json
settings:Current behavior
The code block is minified incorrectly - the names of loop variable and iterable variable are the same:
Expected behavior
For example, this way: