@@ -345,7 +345,7 @@ namespace ts {
345
345
ts . forEach ( getJsDocCommentTextRange ( declaration . parent , sourceFileOfDeclaration ) , jsDocCommentTextRange => {
346
346
let cleanedParamJsDocComment = getCleanedParamJsDocComment ( jsDocCommentTextRange . pos , jsDocCommentTextRange . end , sourceFileOfDeclaration ) ;
347
347
if ( cleanedParamJsDocComment ) {
348
- jsDocCommentParts . push . apply ( jsDocCommentParts , cleanedParamJsDocComment ) ;
348
+ addRange ( jsDocCommentParts , cleanedParamJsDocComment ) ;
349
349
}
350
350
} ) ;
351
351
}
@@ -365,7 +365,7 @@ namespace ts {
365
365
declaration . kind === SyntaxKind . VariableDeclaration ? declaration . parent . parent : declaration , sourceFileOfDeclaration ) , jsDocCommentTextRange => {
366
366
let cleanedJsDocComment = getCleanedJsDocComment ( jsDocCommentTextRange . pos , jsDocCommentTextRange . end , sourceFileOfDeclaration ) ;
367
367
if ( cleanedJsDocComment ) {
368
- jsDocCommentParts . push . apply ( jsDocCommentParts , cleanedJsDocComment ) ;
368
+ addRange ( jsDocCommentParts , cleanedJsDocComment ) ;
369
369
}
370
370
} ) ;
371
371
}
@@ -3812,7 +3812,7 @@ namespace ts {
3812
3812
displayParts . push ( spacePart ( ) ) ;
3813
3813
}
3814
3814
if ( ! ( type . flags & TypeFlags . Anonymous ) ) {
3815
- displayParts . push . apply ( displayParts , symbolToDisplayParts ( typeChecker , type . symbol , enclosingDeclaration , /*meaning*/ undefined , SymbolFormatFlags . WriteTypeParametersOrArguments ) ) ;
3815
+ addRange ( displayParts , symbolToDisplayParts ( typeChecker , type . symbol , enclosingDeclaration , /*meaning*/ undefined , SymbolFormatFlags . WriteTypeParametersOrArguments ) ) ;
3816
3816
}
3817
3817
addSignatureDisplayParts ( signature , allSignatures , TypeFormatFlags . WriteArrowStyleSignature ) ;
3818
3818
break ;
@@ -3873,7 +3873,7 @@ namespace ts {
3873
3873
displayParts . push ( spacePart ( ) ) ;
3874
3874
displayParts . push ( operatorPart ( SyntaxKind . EqualsToken ) ) ;
3875
3875
displayParts . push ( spacePart ( ) ) ;
3876
- displayParts . push . apply ( displayParts , typeToDisplayParts ( typeChecker , typeChecker . getDeclaredTypeOfSymbol ( symbol ) , enclosingDeclaration ) ) ;
3876
+ addRange ( displayParts , typeToDisplayParts ( typeChecker , typeChecker . getDeclaredTypeOfSymbol ( symbol ) , enclosingDeclaration ) ) ;
3877
3877
}
3878
3878
if ( symbolFlags & SymbolFlags . Enum ) {
3879
3879
addNewLineIfDisplayPartsExist ( ) ;
@@ -3919,7 +3919,7 @@ namespace ts {
3919
3919
else if ( signatureDeclaration . kind !== SyntaxKind . CallSignature && signatureDeclaration . name ) {
3920
3920
addFullSymbolName ( signatureDeclaration . symbol ) ;
3921
3921
}
3922
- displayParts . push . apply ( displayParts , signatureToDisplayParts ( typeChecker , signature , sourceFile , TypeFormatFlags . WriteTypeArgumentsOfSignature ) ) ;
3922
+ addRange ( displayParts , signatureToDisplayParts ( typeChecker , signature , sourceFile , TypeFormatFlags . WriteTypeArgumentsOfSignature ) ) ;
3923
3923
}
3924
3924
}
3925
3925
if ( symbolFlags & SymbolFlags . EnumMember ) {
@@ -3980,10 +3980,10 @@ namespace ts {
3980
3980
let typeParameterParts = mapToDisplayParts ( writer => {
3981
3981
typeChecker . getSymbolDisplayBuilder ( ) . buildTypeParameterDisplay ( < TypeParameter > type , writer , enclosingDeclaration ) ;
3982
3982
} ) ;
3983
- displayParts . push . apply ( displayParts , typeParameterParts ) ;
3983
+ addRange ( displayParts , typeParameterParts ) ;
3984
3984
}
3985
3985
else {
3986
- displayParts . push . apply ( displayParts , typeToDisplayParts ( typeChecker , type , enclosingDeclaration ) ) ;
3986
+ addRange ( displayParts , typeToDisplayParts ( typeChecker , type , enclosingDeclaration ) ) ;
3987
3987
}
3988
3988
}
3989
3989
else if ( symbolFlags & SymbolFlags . Function ||
@@ -4017,7 +4017,7 @@ namespace ts {
4017
4017
function addFullSymbolName ( symbol : Symbol , enclosingDeclaration ?: Node ) {
4018
4018
let fullSymbolDisplayParts = symbolToDisplayParts ( typeChecker , symbol , enclosingDeclaration || sourceFile , /*meaning*/ undefined ,
4019
4019
SymbolFormatFlags . WriteTypeParametersOrArguments | SymbolFormatFlags . UseOnlyExternalAliasing ) ;
4020
- displayParts . push . apply ( displayParts , fullSymbolDisplayParts ) ;
4020
+ addRange ( displayParts , fullSymbolDisplayParts ) ;
4021
4021
}
4022
4022
4023
4023
function addPrefixForAnyFunctionOrVar ( symbol : Symbol , symbolKind : string ) {
@@ -4047,7 +4047,7 @@ namespace ts {
4047
4047
}
4048
4048
4049
4049
function addSignatureDisplayParts ( signature : Signature , allSignatures : Signature [ ] , flags ?: TypeFormatFlags ) {
4050
- displayParts . push . apply ( displayParts , signatureToDisplayParts ( typeChecker , signature , enclosingDeclaration , flags | TypeFormatFlags . WriteTypeArgumentsOfSignature ) ) ;
4050
+ addRange ( displayParts , signatureToDisplayParts ( typeChecker , signature , enclosingDeclaration , flags | TypeFormatFlags . WriteTypeArgumentsOfSignature ) ) ;
4051
4051
if ( allSignatures . length > 1 ) {
4052
4052
displayParts . push ( spacePart ( ) ) ;
4053
4053
displayParts . push ( punctuationPart ( SyntaxKind . OpenParenToken ) ) ;
@@ -4064,7 +4064,7 @@ namespace ts {
4064
4064
let typeParameterParts = mapToDisplayParts ( writer => {
4065
4065
typeChecker . getSymbolDisplayBuilder ( ) . buildTypeParameterDisplayFromSymbol ( symbol , writer , enclosingDeclaration ) ;
4066
4066
} ) ;
4067
- displayParts . push . apply ( displayParts , typeParameterParts ) ;
4067
+ addRange ( displayParts , typeParameterParts ) ;
4068
4068
}
4069
4069
}
4070
4070
@@ -5578,7 +5578,7 @@ namespace ts {
5578
5578
// type to the search set
5579
5579
if ( isNameOfPropertyAssignment ( location ) ) {
5580
5580
forEach ( getPropertySymbolsFromContextualType ( location ) , contextualSymbol => {
5581
- result . push . apply ( result , typeChecker . getRootSymbols ( contextualSymbol ) ) ;
5581
+ addRange ( result , typeChecker . getRootSymbols ( contextualSymbol ) ) ;
5582
5582
} ) ;
5583
5583
5584
5584
/* Because in short-hand property assignment, location has two meaning : property name and as value of the property
0 commit comments