@@ -345,7 +345,7 @@ namespace ts {
345345 ts . forEach ( getJsDocCommentTextRange ( declaration . parent , sourceFileOfDeclaration ) , jsDocCommentTextRange => {
346346 let cleanedParamJsDocComment = getCleanedParamJsDocComment ( jsDocCommentTextRange . pos , jsDocCommentTextRange . end , sourceFileOfDeclaration ) ;
347347 if ( cleanedParamJsDocComment ) {
348- jsDocCommentParts . push . apply ( jsDocCommentParts , cleanedParamJsDocComment ) ;
348+ addRange ( jsDocCommentParts , cleanedParamJsDocComment ) ;
349349 }
350350 } ) ;
351351 }
@@ -365,7 +365,7 @@ namespace ts {
365365 declaration . kind === SyntaxKind . VariableDeclaration ? declaration . parent . parent : declaration , sourceFileOfDeclaration ) , jsDocCommentTextRange => {
366366 let cleanedJsDocComment = getCleanedJsDocComment ( jsDocCommentTextRange . pos , jsDocCommentTextRange . end , sourceFileOfDeclaration ) ;
367367 if ( cleanedJsDocComment ) {
368- jsDocCommentParts . push . apply ( jsDocCommentParts , cleanedJsDocComment ) ;
368+ addRange ( jsDocCommentParts , cleanedJsDocComment ) ;
369369 }
370370 } ) ;
371371 }
@@ -3812,7 +3812,7 @@ namespace ts {
38123812 displayParts . push ( spacePart ( ) ) ;
38133813 }
38143814 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 ) ) ;
38163816 }
38173817 addSignatureDisplayParts ( signature , allSignatures , TypeFormatFlags . WriteArrowStyleSignature ) ;
38183818 break ;
@@ -3873,7 +3873,7 @@ namespace ts {
38733873 displayParts . push ( spacePart ( ) ) ;
38743874 displayParts . push ( operatorPart ( SyntaxKind . EqualsToken ) ) ;
38753875 displayParts . push ( spacePart ( ) ) ;
3876- displayParts . push . apply ( displayParts , typeToDisplayParts ( typeChecker , typeChecker . getDeclaredTypeOfSymbol ( symbol ) , enclosingDeclaration ) ) ;
3876+ addRange ( displayParts , typeToDisplayParts ( typeChecker , typeChecker . getDeclaredTypeOfSymbol ( symbol ) , enclosingDeclaration ) ) ;
38773877 }
38783878 if ( symbolFlags & SymbolFlags . Enum ) {
38793879 addNewLineIfDisplayPartsExist ( ) ;
@@ -3919,7 +3919,7 @@ namespace ts {
39193919 else if ( signatureDeclaration . kind !== SyntaxKind . CallSignature && signatureDeclaration . name ) {
39203920 addFullSymbolName ( signatureDeclaration . symbol ) ;
39213921 }
3922- displayParts . push . apply ( displayParts , signatureToDisplayParts ( typeChecker , signature , sourceFile , TypeFormatFlags . WriteTypeArgumentsOfSignature ) ) ;
3922+ addRange ( displayParts , signatureToDisplayParts ( typeChecker , signature , sourceFile , TypeFormatFlags . WriteTypeArgumentsOfSignature ) ) ;
39233923 }
39243924 }
39253925 if ( symbolFlags & SymbolFlags . EnumMember ) {
@@ -3980,10 +3980,10 @@ namespace ts {
39803980 let typeParameterParts = mapToDisplayParts ( writer => {
39813981 typeChecker . getSymbolDisplayBuilder ( ) . buildTypeParameterDisplay ( < TypeParameter > type , writer , enclosingDeclaration ) ;
39823982 } ) ;
3983- displayParts . push . apply ( displayParts , typeParameterParts ) ;
3983+ addRange ( displayParts , typeParameterParts ) ;
39843984 }
39853985 else {
3986- displayParts . push . apply ( displayParts , typeToDisplayParts ( typeChecker , type , enclosingDeclaration ) ) ;
3986+ addRange ( displayParts , typeToDisplayParts ( typeChecker , type , enclosingDeclaration ) ) ;
39873987 }
39883988 }
39893989 else if ( symbolFlags & SymbolFlags . Function ||
@@ -4017,7 +4017,7 @@ namespace ts {
40174017 function addFullSymbolName ( symbol : Symbol , enclosingDeclaration ?: Node ) {
40184018 let fullSymbolDisplayParts = symbolToDisplayParts ( typeChecker , symbol , enclosingDeclaration || sourceFile , /*meaning*/ undefined ,
40194019 SymbolFormatFlags . WriteTypeParametersOrArguments | SymbolFormatFlags . UseOnlyExternalAliasing ) ;
4020- displayParts . push . apply ( displayParts , fullSymbolDisplayParts ) ;
4020+ addRange ( displayParts , fullSymbolDisplayParts ) ;
40214021 }
40224022
40234023 function addPrefixForAnyFunctionOrVar ( symbol : Symbol , symbolKind : string ) {
@@ -4047,7 +4047,7 @@ namespace ts {
40474047 }
40484048
40494049 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 ) ) ;
40514051 if ( allSignatures . length > 1 ) {
40524052 displayParts . push ( spacePart ( ) ) ;
40534053 displayParts . push ( punctuationPart ( SyntaxKind . OpenParenToken ) ) ;
@@ -4064,7 +4064,7 @@ namespace ts {
40644064 let typeParameterParts = mapToDisplayParts ( writer => {
40654065 typeChecker . getSymbolDisplayBuilder ( ) . buildTypeParameterDisplayFromSymbol ( symbol , writer , enclosingDeclaration ) ;
40664066 } ) ;
4067- displayParts . push . apply ( displayParts , typeParameterParts ) ;
4067+ addRange ( displayParts , typeParameterParts ) ;
40684068 }
40694069 }
40704070
@@ -5578,7 +5578,7 @@ namespace ts {
55785578 // type to the search set
55795579 if ( isNameOfPropertyAssignment ( location ) ) {
55805580 forEach ( getPropertySymbolsFromContextualType ( location ) , contextualSymbol => {
5581- result . push . apply ( result , typeChecker . getRootSymbols ( contextualSymbol ) ) ;
5581+ addRange ( result , typeChecker . getRootSymbols ( contextualSymbol ) ) ;
55825582 } ) ;
55835583
55845584 /* Because in short-hand property assignment, location has two meaning : property name and as value of the property
0 commit comments