aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/collapse_vars.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js
index 0dd8754d..97975b1c 100644
--- a/test/compress/collapse_vars.js
+++ b/test/compress/collapse_vars.js
@@ -8050,3 +8050,37 @@ issue_3894: {
"PASS",
]
}
+
+issue_3897: {
+ options = {
+ collapse_vars: true,
+ }
+ input: {
+ var a = 0;
+ (function() {
+ function f(b) {
+ b = a = 1 + a;
+ a = 1 + a;
+ console.log(b);
+ }
+ f();
+ })();
+ console.log(a);
+ }
+ expect: {
+ var a = 0;
+ (function() {
+ function f(b) {
+ b = a = 1 + a;
+ a = 1 + a;
+ console.log(b);
+ }
+ f();
+ })();
+ console.log(a);
+ }
+ expect_stdout: [
+ "1",
+ "2",
+ ]
+}