fix tree traversal on AST_Do (#3047)

fixes #3046
This commit is contained in:
Alex Lam S.L
2018-04-02 22:31:23 +08:00
committed by GitHub
parent fcf542f262
commit e67553fa55
3 changed files with 34 additions and 14 deletions

View File

@@ -93,7 +93,12 @@ TreeTransformer.prototype = new TreeWalker;
self.body = do_list(self.body, tw);
});
_(AST_DWLoop, function(self, tw){
_(AST_Do, function(self, tw){
self.body = self.body.transform(tw);
self.condition = self.condition.transform(tw);
});
_(AST_While, function(self, tw){
self.condition = self.condition.transform(tw);
self.body = self.body.transform(tw);
});