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.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/compress/drop-unused.js b/test/compress/drop-unused.js
index ddf90bfa..96bd336c 100644
--- a/test/compress/drop-unused.js
+++ b/test/compress/drop-unused.js
@@ -1147,3 +1147,28 @@ var_catch_toplevel: {
}();
}
}
+
+reassign_const: {
+ options = {
+ cascade: true,
+ sequences: true,
+ side_effects: true,
+ unused: true,
+ }
+ input: {
+ function f() {
+ const a = 1;
+ a = 2;
+ return a;
+ }
+ console.log(f());
+ }
+ expect: {
+ function f() {
+ const a = 1;
+ return a = 2, a;
+ }
+ console.log(f());
+ }
+ expect_stdout: true
+}