@@ -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
}
@@ -3854,7 +3854,7 @@ namespace ts {
3854
3854
displayParts . push ( spacePart ( ) ) ;
3855
3855
}
3856
3856
if ( ! ( type . flags & TypeFlags . Anonymous ) ) {
3857
- displayParts . push . apply ( displayParts , symbolToDisplayParts ( typeChecker , type . symbol , enclosingDeclaration , /*meaning*/ undefined , SymbolFormatFlags . WriteTypeParametersOrArguments ) ) ;
3857
+ addRange ( displayParts , symbolToDisplayParts ( typeChecker , type . symbol , enclosingDeclaration , /*meaning*/ undefined , SymbolFormatFlags . WriteTypeParametersOrArguments ) ) ;
3858
3858
}
3859
3859
addSignatureDisplayParts ( signature , allSignatures , TypeFormatFlags . WriteArrowStyleSignature ) ;
3860
3860
break ;
@@ -3915,7 +3915,7 @@ namespace ts {
3915
3915
displayParts . push ( spacePart ( ) ) ;
3916
3916
displayParts . push ( operatorPart ( SyntaxKind . EqualsToken ) ) ;
3917
3917
displayParts . push ( spacePart ( ) ) ;
3918
- displayParts . push . apply ( displayParts , typeToDisplayParts ( typeChecker , typeChecker . getDeclaredTypeOfSymbol ( symbol ) , enclosingDeclaration ) ) ;
3918
+ addRange ( displayParts , typeToDisplayParts ( typeChecker , typeChecker . getDeclaredTypeOfSymbol ( symbol ) , enclosingDeclaration ) ) ;
3919
3919
}
3920
3920
if ( symbolFlags & SymbolFlags . Enum ) {
3921
3921
addNewLineIfDisplayPartsExist ( ) ;
@@ -3961,7 +3961,7 @@ namespace ts {
3961
3961
else if ( signatureDeclaration . kind !== SyntaxKind . CallSignature && signatureDeclaration . name ) {
3962
3962
addFullSymbolName ( signatureDeclaration . symbol ) ;
3963
3963
}
3964
- displayParts . push . apply ( displayParts , signatureToDisplayParts ( typeChecker , signature , sourceFile , TypeFormatFlags . WriteTypeArgumentsOfSignature ) ) ;
3964
+ addRange ( displayParts , signatureToDisplayParts ( typeChecker , signature , sourceFile , TypeFormatFlags . WriteTypeArgumentsOfSignature ) ) ;
3965
3965
}
3966
3966
}
3967
3967
if ( symbolFlags & SymbolFlags . EnumMember ) {
@@ -4022,10 +4022,10 @@ namespace ts {
4022
4022
let typeParameterParts = mapToDisplayParts ( writer => {
4023
4023
typeChecker . getSymbolDisplayBuilder ( ) . buildTypeParameterDisplay ( < TypeParameter > type , writer , enclosingDeclaration ) ;
4024
4024
} ) ;
4025
- displayParts . push . apply ( displayParts , typeParameterParts ) ;
4025
+ addRange ( displayParts , typeParameterParts ) ;
4026
4026
}
4027
4027
else {
4028
- displayParts . push . apply ( displayParts , typeToDisplayParts ( typeChecker , type , enclosingDeclaration ) ) ;
4028
+ addRange ( displayParts , typeToDisplayParts ( typeChecker , type , enclosingDeclaration ) ) ;
4029
4029
}
4030
4030
}
4031
4031
else if ( symbolFlags & SymbolFlags . Function ||
@@ -4059,7 +4059,7 @@ namespace ts {
4059
4059
function addFullSymbolName ( symbol : Symbol , enclosingDeclaration ?: Node ) {
4060
4060
let fullSymbolDisplayParts = symbolToDisplayParts ( typeChecker , symbol , enclosingDeclaration || sourceFile , /*meaning*/ undefined ,
4061
4061
SymbolFormatFlags . WriteTypeParametersOrArguments | SymbolFormatFlags . UseOnlyExternalAliasing ) ;
4062
- displayParts . push . apply ( displayParts , fullSymbolDisplayParts ) ;
4062
+ addRange ( displayParts , fullSymbolDisplayParts ) ;
4063
4063
}
4064
4064
4065
4065
function addPrefixForAnyFunctionOrVar ( symbol : Symbol , symbolKind : string ) {
@@ -4089,7 +4089,7 @@ namespace ts {
4089
4089
}
4090
4090
4091
4091
function addSignatureDisplayParts ( signature : Signature , allSignatures : Signature [ ] , flags ?: TypeFormatFlags ) {
4092
- displayParts . push . apply ( displayParts , signatureToDisplayParts ( typeChecker , signature , enclosingDeclaration , flags | TypeFormatFlags . WriteTypeArgumentsOfSignature ) ) ;
4092
+ addRange ( displayParts , signatureToDisplayParts ( typeChecker , signature , enclosingDeclaration , flags | TypeFormatFlags . WriteTypeArgumentsOfSignature ) ) ;
4093
4093
if ( allSignatures . length > 1 ) {
4094
4094
displayParts . push ( spacePart ( ) ) ;
4095
4095
displayParts . push ( punctuationPart ( SyntaxKind . OpenParenToken ) ) ;
@@ -4106,7 +4106,7 @@ namespace ts {
4106
4106
let typeParameterParts = mapToDisplayParts ( writer => {
4107
4107
typeChecker . getSymbolDisplayBuilder ( ) . buildTypeParameterDisplayFromSymbol ( symbol , writer , enclosingDeclaration ) ;
4108
4108
} ) ;
4109
- displayParts . push . apply ( displayParts , typeParameterParts ) ;
4109
+ addRange ( displayParts , typeParameterParts ) ;
4110
4110
}
4111
4111
}
4112
4112
@@ -5620,7 +5620,7 @@ namespace ts {
5620
5620
// type to the search set
5621
5621
if ( isNameOfPropertyAssignment ( location ) ) {
5622
5622
forEach ( getPropertySymbolsFromContextualType ( location ) , contextualSymbol => {
5623
- result . push . apply ( result , typeChecker . getRootSymbols ( contextualSymbol ) ) ;
5623
+ addRange ( result , typeChecker . getRootSymbols ( contextualSymbol ) ) ;
5624
5624
} ) ;
5625
5625
5626
5626
/* Because in short-hand property assignment, location has two meaning : property name and as value of the property
0 commit comments