aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-06-06 22:55:25 +0800
committerGitHub <noreply@github.com>2017-06-06 22:55:25 +0800
commitb9ad53d1ab166115dde78493f937782417e78e00 (patch)
tree3923beadc87c4e16f0257d63685d1c40ba046fd9 /test/compress
parentb0eab71470fa887752bcf5442fbb26da3f724ef1 (diff)
downloadtracifyjs-b9ad53d1ab166115dde78493f937782417e78e00.tar.gz
tracifyjs-b9ad53d1ab166115dde78493f937782417e78e00.zip
fix `inline` handling of `AST_Call.args` (#2059)
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/issue-281.js50
1 files changed, 50 insertions, 0 deletions
diff --git a/test/compress/issue-281.js b/test/compress/issue-281.js
index 6b1b4b40..7a6c03bc 100644
--- a/test/compress/issue-281.js
+++ b/test/compress/issue-281.js
@@ -431,3 +431,53 @@ pure_annotation: {
}
expect_exact: ""
}
+
+drop_fargs: {
+ options = {
+ cascade: true,
+ inline: true,
+ keep_fargs: false,
+ side_effects: true,
+ unused: true,
+ }
+ input: {
+ var a = 1;
+ !function(a_1) {
+ a++;
+ }(a++ + (a && a.var));
+ console.log(a);
+ }
+ expect: {
+ var a = 1;
+ !function() {
+ a++;
+ }(++a && a.var);
+ console.log(a);
+ }
+ expect_stdout: "3"
+}
+
+keep_fargs: {
+ options = {
+ cascade: true,
+ inline: true,
+ keep_fargs: true,
+ side_effects: true,
+ unused: true,
+ }
+ input: {
+ var a = 1;
+ !function(a_1) {
+ a++;
+ }(a++ + (a && a.var));
+ console.log(a);
+ }
+ expect: {
+ var a = 1;
+ !function(a_1) {
+ a++;
+ }(++a && a.var);
+ console.log(a);
+ }
+ expect_stdout: "3"
+}