esmangle icon indicating copy to clipboard operation
esmangle copied to clipboard

Bring some information over passes

Open Constellation opened this issue 13 years ago • 0 comments

For example, we can use constant folding result value to determine target branch is dead or not.

var s = 10;
if (!s) {  // this is dead code
   ...
}

But folding simply, sometimes we generate more codes...

var s = 10000000000000000000000000000000000;  // too big number
s,s,s,s,s,

So I think we attach some information to AST node like __$esmangle_constant to store calculated result.

Constellation avatar Sep 11 '12 18:09 Constellation