general improvements around AST_ForIn (#2796)

- compress using `collapse_vars`
- remove unused `name`
- simplify `loop_body`
This commit is contained in:
Alex Lam S.L
2018-01-16 17:03:12 +08:00
committed by GitHub
parent 424173d311
commit b4aef753e7
4 changed files with 35 additions and 7 deletions

View File

@@ -267,11 +267,10 @@ var AST_For = DEFNODE("For", "init condition step", {
}
}, AST_IterationStatement);
var AST_ForIn = DEFNODE("ForIn", "init name object", {
var AST_ForIn = DEFNODE("ForIn", "init object", {
$documentation: "A `for ... in` statement",
$propdoc: {
init: "[AST_Node] the `for/in` initialization code",
name: "[AST_SymbolRef?] the loop variable, only if `init` is AST_Var",
object: "[AST_Node] the object that we're looping through"
},
_walk: function(visitor) {