aboutsummaryrefslogtreecommitdiff
path: root/test/compress/reduce_vars.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-12-15 19:48:14 +0800
committerGitHub <noreply@github.com>2017-12-15 19:48:14 +0800
commitdb902af4c6e7a8c7e7a690591a0cd6a0d611300f (patch)
tree229145d049835889e9b995944af8ce0595e47596 /test/compress/reduce_vars.js
parent7d6907cb99bac1e835febe30494ebca4c1a671d3 (diff)
downloadtracifyjs-db902af4c6e7a8c7e7a690591a0cd6a0d611300f.tar.gz
tracifyjs-db902af4c6e7a8c7e7a690591a0cd6a0d611300f.zip
fix escape analysis on `||` and `&&` (#2600)
fixes #2598
Diffstat (limited to 'test/compress/reduce_vars.js')
-rw-r--r--test/compress/reduce_vars.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/compress/reduce_vars.js b/test/compress/reduce_vars.js
index 394bb586..bf1155b7 100644
--- a/test/compress/reduce_vars.js
+++ b/test/compress/reduce_vars.js
@@ -4899,3 +4899,27 @@ do_while: {
}
expect_stdout: "PASS"
}
+
+issue_2598: {
+ options = {
+ reduce_funcs: true,
+ reduce_vars: true,
+ toplevel: true,
+ unused: true,
+ }
+ input: {
+ function f() {}
+ function g(a) {
+ return a || f;
+ }
+ console.log(g(false) === g(null));
+ }
+ expect: {
+ function f() {}
+ function g(a) {
+ return a || f;
+ }
+ console.log(g(false) === g(null));
+ }
+ expect_stdout: "true"
+}