File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -823,7 +823,6 @@ function serializeExtractorOutput(
823823 ? { returnTypeMap : Array . from ( symbols . returnTypeMap . entries ( ) ) }
824824 : { } ) ,
825825 ...( symbols . callAssignments ?. length ? { callAssignments : symbols . callAssignments } : { } ) ,
826- ...( symbols . paramBindings ?. length ? { paramBindings : symbols . paramBindings } : { } ) ,
827826 } ;
828827}
829828
Original file line number Diff line number Diff line change @@ -122,7 +122,6 @@ function deserializeResult(ser: SerializedExtractorOutput | null): ExtractorOutp
122122 out . returnTypeMap = returnTypeMap ;
123123 }
124124 if ( ser . callAssignments ?. length ) out . callAssignments = ser . callAssignments ;
125- if ( ser . paramBindings ?. length ) out . paramBindings = ser . paramBindings ;
126125 return out ;
127126}
128127
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