aboutsummaryrefslogtreecommitdiff
path: root/test/compress/dead-code.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/compress/dead-code.js')
-rw-r--r--test/compress/dead-code.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/compress/dead-code.js b/test/compress/dead-code.js
index a2ebf37a..4f731875 100644
--- a/test/compress/dead-code.js
+++ b/test/compress/dead-code.js
@@ -1290,12 +1290,37 @@ self_assignments_5: {
}
expect: {
var i = 0, l = [ "FAIL", "PASS" ];
+ l[0];
+ l[0];
l[0] = l[1];
console.log(l[0], 2);
}
expect_stdout: "PASS 2"
}
+self_assignments_6: {
+ options = {
+ dead_code: true,
+ pure_getters: "strict",
+ reduce_vars: true,
+ side_effects: true,
+ toplevel: true,
+ }
+ input: {
+ var o = {
+ p: "PASS",
+ };
+ console.log(o.p = o.p);
+ }
+ expect: {
+ var o = {
+ p: "PASS",
+ };
+ console.log(o.p);
+ }
+ expect_stdout: "PASS"
+}
+
issue_3967: {
options = {
dead_code: true,