diff options
author | Mihai Bazon <mihai@bazon.net> | 2015-01-06 12:27:23 +0200 |
---|---|---|
committer | Mihai Bazon <mihai@bazon.net> | 2015-01-06 12:29:07 +0200 |
commit | 6b23cbc8522bdc6d28e1abb44eb2d1d6eb6b697a (patch) | |
tree | da0ec2875451e4615e292e54aadcd7ac3a71a5fd | |
parent | 7f9bc9e863addac4bd17c09beb94a01faaea0aad (diff) | |
download | tracifyjs-6b23cbc8522bdc6d28e1abb44eb2d1d6eb6b697a.tar.gz tracifyjs-6b23cbc8522bdc6d28e1abb44eb2d1d6eb6b697a.zip |
AST_Do nodes: walk body before condition
-rw-r--r-- | lib/ast.js | 18 |
1 files changed, 12 insertions, 6 deletions
@@ -205,21 +205,27 @@ var AST_DWLoop = DEFNODE("DWLoop", "condition", { $documentation: "Base class for do/while statements", $propdoc: { condition: "[AST_Node] the loop condition. Should not be instanceof AST_Statement" - }, - _walk: function(visitor) { - return visitor._visit(this, function(){ - this.condition._walk(visitor); - this.body._walk(visitor); - }); } }, AST_IterationStatement); var AST_Do = DEFNODE("Do", null, { $documentation: "A `do` statement", + _walk: function(visitor) { + return visitor._visit(this, function(){ + this.body._walk(visitor); + this.condition._walk(visitor); + }); + } }, AST_DWLoop); var AST_While = DEFNODE("While", null, { $documentation: "A `while` statement", + _walk: function(visitor) { + return visitor._visit(this, function(){ + this.condition._walk(visitor); + this.body._walk(visitor); + }); + } }, AST_DWLoop); var AST_For = DEFNODE("For", "init condition step", { |