esmangle
esmangle copied to clipboard
constant folding
Just a general reminder to do constant folding.
-
"a" + "b"->"ab" -
0 + 1->1 -
typeof function(){}->"function" - etc.
At first, we should implement tree based constant folindg (not considering variable)
I've implemented tree-based-constant-folding pass! 9184d32c1acdec07a0355165573cd3458c905892
In tree-based-constant-folding pass, additionally we should handle above pass,
- function expression
- array expression
- object expression
typeof function() { }