aboutsummaryrefslogtreecommitdiff
path: root/test/compress/functions.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-12-19 03:05:30 +0800
committerGitHub <noreply@github.com>2017-12-19 03:05:30 +0800
commit4b334edf491bd4c43a72e1a08ad2cf360f240515 (patch)
treea99ae7a0061472c7a8c898e47b6a75bfac6733f4 /test/compress/functions.js
parent8ddcbc39e617a3ce53a340303fd9ef3226ee0065 (diff)
downloadtracifyjs-4b334edf491bd4c43a72e1a08ad2cf360f240515.tar.gz
tracifyjs-4b334edf491bd4c43a72e1a08ad2cf360f240515.zip
handle global constant collision with local variable after `inline` (#2617)
fixes #2616
Diffstat (limited to 'test/compress/functions.js')
-rw-r--r--test/compress/functions.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/compress/functions.js b/test/compress/functions.js
index 23ed22df..c8b7ed6f 100644
--- a/test/compress/functions.js
+++ b/test/compress/functions.js
@@ -1049,3 +1049,37 @@ unsafe_call_2: {
}
expect_stdout: true
}
+
+issue_2616: {
+ options = {
+ evaluate: true,
+ inline: true,
+ reduce_vars: true,
+ side_effects: true,
+ unused: true,
+ }
+ input: {
+ var c = "FAIL";
+ (function() {
+ function f() {
+ function g(NaN) {
+ (true << NaN) - 0/0 || (c = "PASS");
+ }
+ g([]);
+ }
+ f();
+ })();
+ console.log(c);
+ }
+ expect: {
+ var c = "FAIL";
+ (function() {
+ (function() {
+ NaN = [], (true << NaN) - 0/0 || (c = "PASS");
+ var NaN;
+ })();
+ })();
+ console.log(c);
+ }
+ expect_stdout: "PASS"
+}