support class literals (#4658)

This commit is contained in:
Alex Lam S.L
2021-02-23 14:55:08 +00:00
committed by GitHub
parent e535f19189
commit d68d155f93
18 changed files with 1701 additions and 175 deletions

View File

@@ -147,6 +147,15 @@ TreeTransformer.prototype = new TreeWalker;
}
DEF(AST_Arrow, transform_arrow);
DEF(AST_AsyncArrow, transform_arrow);
DEF(AST_Class, function(self, tw) {
if (self.name) self.name = self.name.transform(tw);
if (self.extends) self.extends = self.extends.transform(tw);
self.properties = do_list(self.properties, tw);
});
DEF(AST_ClassProperty, function(self, tw) {
if (self.key instanceof AST_Node) self.key = self.key.transform(tw);
if (self.value) self.value = self.value.transform(tw);
});
DEF(AST_Call, function(self, tw) {
self.expression = self.expression.transform(tw);
self.args = do_list(self.args, tw);