support rest parameters (#4515)

This commit is contained in:
Alex Lam S.L
2021-01-07 02:04:09 +00:00
committed by GitHub
parent 68497d0258
commit c3d358a5b8
12 changed files with 819 additions and 135 deletions

View File

@@ -119,6 +119,7 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options) {
node.argnames.forEach(function(argname) {
argname.walk(tw);
});
if (node.rest) node.rest.walk(tw);
walk_body(node, tw);
});
return true;
@@ -220,6 +221,7 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options) {
node.argnames.forEach(function(argname) {
argname.walk(tw);
});
if (node.rest) node.rest.walk(tw);
in_arg.pop();
if (node instanceof AST_Arrow && node.value) {
node.value.walk(tw);