if (is_reachable(scope, [ def ])) break;
def.fixed = false;
return strip_assignment();
+ } else if (parent instanceof AST_VarDef) {
+ if (parent.name.definition() !== def) continue;
+ if (in_try(level, parent)) break;
+ def.fixed = false;
+ return strip_assignment();
}
} while (parent instanceof AST_Binary && parent.right === node
|| parent instanceof AST_Sequence && parent.tail_node() === node
}
expect_stdout: "PASS"
}
+
+redundant_assignments: {
+ options = {
+ dead_code: true,
+ }
+ input: {
+ var a = a = "PASS", b = "FAIL";
+ b = b = "PASS";
+ console.log(a, b);
+ }
+ expect: {
+ var a = "PASS", b = "FAIL";
+ b = "PASS";
+ console.log(a, b);
+ }
+ expect_stdout: "PASS PASS"
+}