UglifyJS-old
UglifyJS-old copied to clipboard
Join assignment
See #223 - basically, this is about joining assignment statements into expressions when appropriate:
a=1;f(2,5,1)
f(2,5,a=1)
This one is buggy:
// problem 1: this.foo is dropped
this.foo = 0;
this.bar = 0;
this.baz = 0;
// problem 2: b -= b += 5?
if (a < 0) b += 5;
else b -= 5;
===> uglified:
this.baz = this.bar = 0, a < 0 && (b -= b += 5);
Fixed one easy bug, only simple assignments (=) are treated this way now, but the problems with this.foo being dropped and if (a) b=2; else c=2 getting compiled to a&&(c=b=2) still remain. :(