mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
fix hasThisParameter to check for parameters length
This commit is contained in:
1 parent
9270e58eaf
commit
7d86fda151
1 file changed
+1
-1
@@ -139,7 +139,7 @@ namespace ts.refactor.convertToNamedParameters {
|
||||
}
|
||||
|
||||
function hasThisParameter(parameters: NodeArray<ParameterDeclaration>): boolean {
|
||||
return isThis(parameters[0].name);
|
||||
return parameters.length > 0 && isThis(parameters[0].name);
|
||||
}
|
||||
|
||||
function getRefactorableParametersLength(parameters: NodeArray<ParameterDeclaration>): number {
|
||||
|
||||
Reference in new issue
Block a user