diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-12-17 10:23:41 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-17 18:23:41 +0800 |
commit | a96f087ac33b6d18d5ffa3cacd39dd693defb7cf (patch) | |
tree | d670eab7971cb7bf27e029319db0357ff38e51d5 /lib/transform.js | |
parent | 75e9fd84174eaa8bf97975ad254fe06958564547 (diff) | |
download | tracifyjs-a96f087ac33b6d18d5ffa3cacd39dd693defb7cf.tar.gz tracifyjs-a96f087ac33b6d18d5ffa3cacd39dd693defb7cf.zip |
support arrow function (#4385)
Diffstat (limited to 'lib/transform.js')
-rw-r--r-- | lib/transform.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/transform.js b/lib/transform.js index 398cf73d..5372cc59 100644 --- a/lib/transform.js +++ b/lib/transform.js @@ -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); |