mishoo/UglifyJS2 — pull request #541 by TalAter (2014-09-02 22:38:52+00:00)
Title: Conditional assignment of equivalent constants compressed  ( x=y?1:1 --> x=1 )

When all possible outcomes of a conditional assignment are equivalent constants, and the condition has no side effects, compress them into a simple assignment.

For example:
````javascript
if (y) {
x = 1+1;
} else {
x = 2;
}
// will become x=2;

if (y) {
x = 1+1;
} else if (z) {
x = 2;
} else {
x = 3-1;
}
// will become x=2;

x = y ? 'foo' : 'fo'+'o';
// will become x='foo';

x = y ? 'foo' : y ? 'foo' : 'fo'+'o';
// will become x='foo';
````

Compressed and evaluated:
````javascript
//Before this change:
x=y?2:2; x=y?2:z?2:2; x=y?"foo":"foo"; x=y?"foo":y?"foo":"foo";
//After this change:
x=2; x=2; x="foo"; x="foo";
````