Commit 6e87234
committed
fix(extractor): resolve arrow-function rest-param bindings via enclosing variable_declarator (#1331)
extractObjectRestParamBindingsWalk checked childForFieldName('name') on
every function node, but arrow_function and function_expression nodes have
no name field in the tree-sitter grammar — so const f = ({ ...rest }) => {}
always produced an undefined funcName and silently skipped the entire
parameter scan.
Fix: when childForFieldName('name') returns null and the parent node is a
variable_declarator, fall back to the declarator's own name field. This
mirrors the same pattern used in extractSpreadForOfWalk for arrow functions.
Closes the gap reported in the Greptile review (comment 3367102930).1 parent d387644 commit 6e87234
1 file changed
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2070 | 2070 | | |
2071 | 2071 | | |
2072 | 2072 | | |
2073 | | - | |
| 2073 | + | |
| 2074 | + | |
| 2075 | + | |
| 2076 | + | |
| 2077 | + | |
| 2078 | + | |
| 2079 | + | |
| 2080 | + | |
2074 | 2081 | | |
2075 | 2082 | | |
2076 | 2083 | | |
| |||
0 commit comments