aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2018-04-24 20:31:50 +0800
committerGitHub <noreply@github.com>2018-04-24 20:31:50 +0800
commit27211cf2d58c1a28fad6d26e27d667d3ee6e0028 (patch)
tree5f2225b057845ce85c66ebfd6ae69de55e832424 /test
parentb5ce1997112007d772e23bb04e09ed425bff608a (diff)
downloadtracifyjs-27211cf2d58c1a28fad6d26e27d667d3ee6e0028.tar.gz
tracifyjs-27211cf2d58c1a28fad6d26e27d667d3ee6e0028.zip
handle RHS side-effects in `collapse_vars` (#3097)
fixes #3096
Diffstat (limited to 'test')
-rw-r--r--test/compress/collapse_vars.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js
index e97f1031..950ebd07 100644
--- a/test/compress/collapse_vars.js
+++ b/test/compress/collapse_vars.js
@@ -5327,3 +5327,24 @@ issue_3032: {
}
expect_stdout: "42"
}
+
+issue_3096: {
+ options = {
+ collapse_vars: true,
+ }
+ input: {
+ console.log(function() {
+ var ar = ["a", "b"];
+ var first = ar.pop();
+ return ar + "" + first;
+ }());
+ }
+ expect: {
+ console.log(function() {
+ var ar = ["a", "b"];
+ var first = ar.pop();
+ return ar + "" + first;
+ }());
+ }
+ expect_stdout: "ab"
+}