init.walk(tw);
if (init instanceof AST_Definitions) {
init.definitions[0].name.match_symbol(function(node) {
- if (node instanceof AST_SymbolDeclaration) node.definition().fixed = false;
+ if (node instanceof AST_SymbolDeclaration) {
+ var def = node.definition();
+ def.assignments++;
+ def.fixed = false;
+ }
}, true);
- } else if (init instanceof AST_SymbolRef) {
- init.definition().fixed = false;
+ } else if (init instanceof AST_SymbolRef && !init.is_immutable()) {
+ var def = init.definition();
+ def.assignments++;
+ def.fixed = false;
}
this.body.walk(tw);
pop(tw);
}
expect_stdout: "PASS"
}
+
+issue_4432: {
+ options = {
+ arguments: true,
+ reduce_vars: true,
+ }
+ input: {
+ console.log(function(a) {
+ for (a in { FAIL: 42 });
+ return arguments[0];
+ }() || "PASS");
+ }
+ expect: {
+ console.log(function(a) {
+ for (a in { FAIL: 42 });
+ return arguments[0];
+ }() || "PASS");
+ }
+ expect_stdout: "PASS"
+}