fix: only record declared args

This commit is contained in:
Dmitry Vasilev
2022-12-27 19:00:37 +08:00
parent d83c1c8c97
commit 04c47a44e8
2 changed files with 17 additions and 14 deletions

View File

@@ -75,9 +75,12 @@ const codegen_function_expr = (node, cxt) => {
: '(' + do_codegen(node.body) + ')'
)
const argscount = node.function_args.children.find(a => a.type == 'rest') != null
? node.function_args.children.length
: null
const argscount = node
.function_args
.children
.find(a => a.type == 'destructuring_rest') == null
? node.function_args.children.length
: null
const location = `{index: ${node.index}, length: ${node.length}, module: '${cxt.module}'}`