mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-08 22:29:37 -05:00
fix hasThisParameter to check for parameters length
This commit is contained in:
@@ -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