support arrow function (#4385)

This commit is contained in:
Alex Lam S.L
2020-12-17 10:23:41 +00:00
committed by GitHub
parent 75e9fd8417
commit a96f087ac3
11 changed files with 732 additions and 117 deletions

View File

@@ -131,6 +131,14 @@ TreeTransformer.prototype = new TreeWalker;
self.argnames = do_list(self.argnames, tw);
self.body = do_list(self.body, tw);
});
DEF(AST_Arrow, function(self, tw) {
self.argnames = do_list(self.argnames, tw);
if (self.value) {
self.value = self.value.transform(tw);
} else {
self.body = do_list(self.body, tw);
}
});
DEF(AST_Call, function(self, tw) {
self.expression = self.expression.transform(tw);
self.args = do_list(self.args, tw);