madskristensen / BundlerMinifier

Visual Studio extension
Other
611 stars 171 forks source link

Issue with minimize transforming to object to the same name #580

Open rwdevlead opened 2 years ago

rwdevlead commented 2 years ago

Installed product versions

Description

When minifying the following code, variables of the same name are used in the transformation that leads to bugs in the JavaScript minimized file.

Steps to recreate

  1. Withing a .js file create an ajax call to retrieve some data.
  2. upon success of data retrieval, loop through an array from within the returned value.
  3. use this language for the loop for(let accts of data.accounts)

Current behavior

for(let accts of data.accounts) minimizes into for(let t of t) Both the variable and the array property end up with the same name.

Expected behavior

for(let accts of data.accounts) minimizes into for(let a of b) The variable and property should have different names