return true;
}
if (node instanceof AST_ForIn) {
- if (node.init instanceof AST_SymbolRef) {
- var d = node.init.definition();
- d.references.push(node.init);
- d.fixed = false;
- } else {
- node.init.walk(tw);
+ var sym = node.init;
+ if (sym instanceof AST_Var) {
+ sym = sym.definitions[0].name;
}
+ var d = sym.definition();
+ d.references.push(sym);
+ d.fixed = false;
node.object.walk(tw);
push();
node.body.walk(tw);
}
}
-inner_var_for_in: {
+inner_var_for_in_1: {
options = {
evaluate: true,
reduce_vars: true,
}
}
+inner_var_for_in_2: {
+ options = {
+ evaluate: true,
+ reduce_vars: true,
+ }
+ input: {
+ for (var long_name in {})
+ console.log(long_name);
+ }
+ expect: {
+ for (var long_name in {})
+ console.log(long_name);
+ }
+}
+
issue_1533_1: {
options = {
collapse_vars: true,