aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-07-08 04:42:35 +0800
committerGitHub <noreply@github.com>2017-07-08 04:42:35 +0800
commit71ee91e716a7fb0f1ef8a4a80a627e10944ef062 (patch)
tree9f0dec2561c5d2117fd4667574eff711e6be1aba /test/compress
parent4f70d2e28c9ffd6404756ed3ebf08a448aef5257 (diff)
downloadtracifyjs-71ee91e716a7fb0f1ef8a4a80a627e10944ef062.tar.gz
tracifyjs-71ee91e716a7fb0f1ef8a4a80a627e10944ef062.zip
handle duplicate argument names in `collapse_vars` (#2215)
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/collapse_vars.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js
index 7f3c470b..10c403fa 100644
--- a/test/compress/collapse_vars.js
+++ b/test/compress/collapse_vars.js
@@ -2320,3 +2320,25 @@ issue_2203_2: {
}
expect_stdout: "PASS"
}
+
+duplicate_argname: {
+ options = {
+ collapse_vars: true,
+ unused: true,
+ }
+ input: {
+ function f() { return "PASS"; }
+ console.log(function(a, a) {
+ f++;
+ return a;
+ }("FAIL", f()));
+ }
+ expect: {
+ function f() { return "PASS"; }
+ console.log(function(a, a) {
+ f++;
+ return a;
+ }("FAIL", f()));
+ }
+ expect_stdout: "PASS"
+}