mishoo/UglifyJS2 — pull request #222 by ashi009 (2013-06-06 10:13:09+00:00)
Title: New compressing switch for inlining constant variables (number, bool, qualified string)

Added two new switches for compressing stage.

`inlineconst: false` default to false
`inlinestr: false` default to false, available when `inlineconst` is set, which indicates the maximum length of a the strings should be inlined.

Inlining constant variables is useful in shorten script length when using enumerate constant etc. Meanwhile it could improve performance a [little](http://jsperf.com/bitflags-vs-string-comparisons/3) in some circumstances.

Note that, current version doesn't support nested declaration, eg:

function outer() {
var x = 1;
function inner() {
var x = 2;
return x;
}
return x + inner();
}

## Example

Using `inlineconst=true, inlinestr=2`

function t() {
var num = 1 << 10, bool = true, str1 = "1", str2 = "12";
return num + bool + str1 + str2;
}

becomes

function t() {
var str2 = "12";
return "10251" + str2;
}