@@ -286,7 +286,7 @@ function getArgumentOrParameterListInfo(node: Node, position: number, sourceFile
286
286
if ( ! info ) return undefined ;
287
287
const { list, argumentIndex } = info ;
288
288
289
- const argumentCount = getArgumentIndexOrCount ( checker , list , /*node*/ undefined ) ;
289
+ const argumentCount = getArgumentCount ( checker , list ) ;
290
290
if ( argumentIndex !== 0 ) {
291
291
Debug . assertLessThan ( argumentIndex , argumentCount ) ;
292
292
}
@@ -307,7 +307,7 @@ function getArgumentOrParameterListAndIndex(node: Node, sourceFile: SourceFile,
307
307
// - On the target of the call (parent.func)
308
308
// - On the 'new' keyword in a 'new' expression
309
309
const list = findContainingList ( node ) ;
310
- return list && { list, argumentIndex : getArgumentIndexOrCount ( checker , list , node ) } ;
310
+ return list && { list, argumentIndex : getArgumentIndex ( checker , list , node ) } ;
311
311
}
312
312
}
313
313
@@ -492,6 +492,14 @@ function getSpreadElementCount(node: SpreadElement, checker: TypeChecker) {
492
492
return 0 ;
493
493
}
494
494
495
+ function getArgumentIndex ( checker : TypeChecker , argumentsList : Node , node : Node ) {
496
+ return getArgumentIndexOrCount ( checker , argumentsList , node ) ;
497
+ }
498
+
499
+ function getArgumentCount ( checker : TypeChecker , argumentsList : Node ) {
500
+ return getArgumentIndexOrCount ( checker , argumentsList , /*node*/ undefined ) ;
501
+ }
502
+
495
503
function getArgumentIndexOrCount ( checker : TypeChecker , argumentsList : Node , node : Node | undefined ) {
496
504
// The list we got back can include commas. In the presence of errors it may
497
505
// also just have nodes without commas. For example "Foo(a b c)" will have 3
0 commit comments