@@ -286,7 +286,7 @@ function getArgumentOrParameterListInfo(node: Node, position: number, sourceFile
286286 if ( ! info ) return undefined ;
287287 const { list, argumentIndex } = info ;
288288
289- const argumentCount = getArgumentIndexOrCount ( checker , list , /*node*/ undefined ) ;
289+ const argumentCount = getArgumentCount ( checker , list ) ;
290290 if ( argumentIndex !== 0 ) {
291291 Debug . assertLessThan ( argumentIndex , argumentCount ) ;
292292 }
@@ -307,7 +307,7 @@ function getArgumentOrParameterListAndIndex(node: Node, sourceFile: SourceFile,
307307 // - On the target of the call (parent.func)
308308 // - On the 'new' keyword in a 'new' expression
309309 const list = findContainingList ( node ) ;
310- return list && { list, argumentIndex : getArgumentIndexOrCount ( checker , list , node ) } ;
310+ return list && { list, argumentIndex : getArgumentIndex ( checker , list , node ) } ;
311311 }
312312}
313313
@@ -492,6 +492,14 @@ function getSpreadElementCount(node: SpreadElement, checker: TypeChecker) {
492492 return 0 ;
493493}
494494
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+
495503function getArgumentIndexOrCount ( checker : TypeChecker , argumentsList : Node , node : Node | undefined ) {
496504 // The list we got back can include commas. In the presence of errors it may
497505 // also just have nodes without commas. For example "Foo(a b c)" will have 3
0 commit comments