js-compiler: Add scope tracking for function rest params
MODIFY
packages/@romejs/js-compiler/scope/utils.ts
packages/@romejs/js-compiler/scope/utils.ts
@@ -24,8 +24,11 @@ export function addFunctionBindings(
// Add type parameters
scope.evaluate(head.typeParameters);
+ const params =
+ head.rest === undefined ? head.params : [...head.params, head.rest];
+
// Add parameters
- for (const param of head.params) {
+ for (const param of params) {
for (const id of getBindingIdentifiers(param)) {
// TODO maybe add a `param` binding type?
scope.addBinding(

js-compiler: Add scope tracking for function rest params