File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ export interface SerializedExtractorOutput {
7070 arrayCallbackBindings ?: import ( '../types.js' ) . ArrayCallbackBinding [ ] ;
7171 objectRestParamBindings ?: import ( '../types.js' ) . ObjectRestParamBinding [ ] ;
7272 objectPropBindings ?: import ( '../types.js' ) . ObjectPropBinding [ ] ;
73+ paramBindings ?: import ( '../types.js' ) . ParamBinding [ ] ;
7374 newExpressions ?: readonly string [ ] ;
7475 returnTypeMap ?: Array < [ string , TypeMapEntry ] > ;
7576 callAssignments ?: CallAssignment [ ] ;
Original file line number Diff line number Diff line change @@ -2070,7 +2070,14 @@ function extractObjectRestParamBindingsWalk(
20702070 if ( depth >= MAX_WALK_DEPTH ) return ;
20712071 const t = node . type ;
20722072 if ( t === 'function_declaration' || t === 'function_expression' || t === 'arrow_function' ) {
2073- const nameNode = node . childForFieldName ( 'name' ) ;
2073+ // `function_declaration` has a `name` field; `arrow_function` and
2074+ // `function_expression` do not — get the name from the enclosing
2075+ // `variable_declarator` instead (e.g. `const f3 = ({ ...rest }) => {}`).
2076+ const nameNode =
2077+ node . childForFieldName ( 'name' ) ??
2078+ ( node . parent ?. type === 'variable_declarator'
2079+ ? node . parent . childForFieldName ( 'name' )
2080+ : null ) ;
20742081 const funcName = nameNode ?. text ;
20752082 if ( funcName ) {
20762083 const paramsNode =
You can’t perform that action at this time.
0 commit comments