mishoo/UglifyJS — Issue #326: Remove double-declaration of variables
Author: thejh
Created: 2012-02-25 17:34:50+00:00
State: open

There's often code like this:

for (var i=0; i<5; i++) foo(i)
for (var i=0; i<7; i++) bar(i)

Currently, uglifyjs converts it to this:

for(var i=0;i<5;i++)foo(i);for(var i=0;i<5;i++)bar(i);

I think it should convert it to this instead:

for(var i=0;i<5;i++)foo(i);for(i=0;i<5;i++)bar(i);