aboutsummaryrefslogtreecommitdiff
path: root/test/compress/drop-unused.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/compress/drop-unused.js')
-rw-r--r--test/compress/drop-unused.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/compress/drop-unused.js b/test/compress/drop-unused.js
index 99d9cace..2eefbe8d 100644
--- a/test/compress/drop-unused.js
+++ b/test/compress/drop-unused.js
@@ -1029,3 +1029,30 @@ delete_assign_2: {
}
expect_stdout: true
}
+
+drop_var: {
+ options = {
+ toplevel: true,
+ unused: true,
+ }
+ input: {
+ var a;
+ console.log(a, b);
+ var a = 1, b = 2;
+ console.log(a, b);
+ var a = 3;
+ console.log(a, b);
+ }
+ expect: {
+ console.log(a, b);
+ var a = 1, b = 2;
+ console.log(a, b);
+ a = 3;
+ console.log(a, b);
+ }
+ expect_stdout: [
+ "undefined undefined",
+ "1 2",
+ "3 2",
+ ]
+}