Feature suggestion: optimizing `var` definitions

Author: chrisaljoudiCreated Dec 22, 2012Updated Oct 11, 2024

Hi! I came across a case where there's a possible trick that can reduce size significantly. Take the following piece of code:

javascript
var x = 12345678, y = 12345678;

It compresses to:

javascript
var x=12345678,y=12345678;

Can't it be optimized to the following:

javascript
var x=12345678,y=x;

Or is there something I'm missing? I think it should be available as an unsafe optimization.

Thanks!