an AST_If is too a StatementWithBody

This commit is contained in:
Mihai Bazon
2012-09-03 12:11:44 +03:00
parent d7c1dc6c05
commit 6d0db4ce14
4 changed files with 21 additions and 17 deletions

View File

@@ -286,16 +286,16 @@ var AST_Continue = DEFNODE("Continue", null, {
/* -----[ IF ]----- */
var AST_If = DEFNODE("If", "condition consequent alternative", {
var AST_If = DEFNODE("If", "condition alternative", {
$documentation: "A `if` statement",
_walk: function(visitor) {
return visitor._visit(this, function(){
this.condition._walk(visitor);
this.consequent._walk(visitor);
this.body._walk(visitor);
if (this.alternative) this.alternative._walk(visitor);
});
}
});
}, AST_StatementWithBody);
/* -----[ SWITCH ]----- */