diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2018-01-29 17:41:15 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-29 17:41:15 +0800 |
commit | 541e6011af7647074a41c5a82a0a16a3d32bb8c6 (patch) | |
tree | 7cb1e3ccaec87acd38b32c8ae25084fa780b311c /test/compress | |
parent | 6fa3fbeae84200c90ff47dde03545742a861be17 (diff) | |
download | tracifyjs-541e6011af7647074a41c5a82a0a16a3d32bb8c6.tar.gz tracifyjs-541e6011af7647074a41c5a82a0a16a3d32bb8c6.zip |
improve symbol replacement heuristic (#2851)
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/reduce_vars.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/compress/reduce_vars.js b/test/compress/reduce_vars.js index 2231587d..2e562f94 100644 --- a/test/compress/reduce_vars.js +++ b/test/compress/reduce_vars.js @@ -5435,3 +5435,35 @@ lvalues_def_2: { } expect_stdout: "2 NaN" } + +chained_assignments: { + options = { + evaluate: true, + inline: true, + reduce_vars: true, + sequences: true, + side_effects: true, + toplevel: true, + unsafe: true, + unused: true, + } + input: { + function f() { + var a = [0x5e, 0xad, 0xbe, 0xef]; + var b = 0; + b |= a[0]; + b <<= 8; + b |= a[1]; + b <<= 8; + b |= a[2]; + b <<= 8; + b |= a[3]; + return b; + } + console.log(f().toString(16)); + } + expect: { + console.log("5eadbeef"); + } + expect_stdout: "5eadbeef" +} |