aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2018-01-13 02:46:14 +0800
committerGitHub <noreply@github.com>2018-01-13 02:46:14 +0800
commite49416e4aaba8d057eefd8d4250fd2ba6c7a4e04 (patch)
tree49dfbb9dbd037ee7fb35af422a17135afbe29396 /test
parentd4d7d99b70da46303aff3152cec197c371596d0b (diff)
downloadtracifyjs-e49416e4aaba8d057eefd8d4250fd2ba6c7a4e04.tar.gz
tracifyjs-e49416e4aaba8d057eefd8d4250fd2ba6c7a4e04.zip
fix `reduce_vars` on `AST_Accessor` (#2776)
fixes #2774
Diffstat (limited to 'test')
-rw-r--r--test/compress/reduce_vars.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/compress/reduce_vars.js b/test/compress/reduce_vars.js
index 3d993b90..ec0471a8 100644
--- a/test/compress/reduce_vars.js
+++ b/test/compress/reduce_vars.js
@@ -5276,3 +5276,29 @@ duplicate_lambda_defun_name_2: {
}
expect_stdout: "0"
}
+
+issue_2774: {
+ options = {
+ reduce_vars: true,
+ unused: true,
+ }
+ input: {
+ console.log({
+ get a() {
+ var b;
+ (b = true) && b.c;
+ b = void 0;
+ }
+ }.a);
+ }
+ expect: {
+ console.log({
+ get a() {
+ var b;
+ (b = true) && b.c;
+ b = void 0;
+ }
+ }.a);
+ }
+ expect_stdout: "undefined"
+}