@@ -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 }
@@ -3854,7 +3854,7 @@ namespace ts {
38543854 displayParts . push ( spacePart ( ) ) ;
38553855 }
38563856 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 ) ) ;
38583858 }
38593859 addSignatureDisplayParts ( signature , allSignatures , TypeFormatFlags . WriteArrowStyleSignature ) ;
38603860 break ;
@@ -3915,7 +3915,7 @@ namespace ts {
39153915 displayParts . push ( spacePart ( ) ) ;
39163916 displayParts . push ( operatorPart ( SyntaxKind . EqualsToken ) ) ;
39173917 displayParts . push ( spacePart ( ) ) ;
3918- displayParts . push . apply ( displayParts , typeToDisplayParts ( typeChecker , typeChecker . getDeclaredTypeOfSymbol ( symbol ) , enclosingDeclaration ) ) ;
3918+ addRange ( displayParts , typeToDisplayParts ( typeChecker , typeChecker . getDeclaredTypeOfSymbol ( symbol ) , enclosingDeclaration ) ) ;
39193919 }
39203920 if ( symbolFlags & SymbolFlags . Enum ) {
39213921 addNewLineIfDisplayPartsExist ( ) ;
@@ -3961,7 +3961,7 @@ namespace ts {
39613961 else if ( signatureDeclaration . kind !== SyntaxKind . CallSignature && signatureDeclaration . name ) {
39623962 addFullSymbolName ( signatureDeclaration . symbol ) ;
39633963 }
3964- displayParts . push . apply ( displayParts , signatureToDisplayParts ( typeChecker , signature , sourceFile , TypeFormatFlags . WriteTypeArgumentsOfSignature ) ) ;
3964+ addRange ( displayParts , signatureToDisplayParts ( typeChecker , signature , sourceFile , TypeFormatFlags . WriteTypeArgumentsOfSignature ) ) ;
39653965 }
39663966 }
39673967 if ( symbolFlags & SymbolFlags . EnumMember ) {
@@ -4022,10 +4022,10 @@ namespace ts {
40224022 let typeParameterParts = mapToDisplayParts ( writer => {
40234023 typeChecker . getSymbolDisplayBuilder ( ) . buildTypeParameterDisplay ( < TypeParameter > type , writer , enclosingDeclaration ) ;
40244024 } ) ;
4025- displayParts . push . apply ( displayParts , typeParameterParts ) ;
4025+ addRange ( displayParts , typeParameterParts ) ;
40264026 }
40274027 else {
4028- displayParts . push . apply ( displayParts , typeToDisplayParts ( typeChecker , type , enclosingDeclaration ) ) ;
4028+ addRange ( displayParts , typeToDisplayParts ( typeChecker , type , enclosingDeclaration ) ) ;
40294029 }
40304030 }
40314031 else if ( symbolFlags & SymbolFlags . Function ||
@@ -4059,7 +4059,7 @@ namespace ts {
40594059 function addFullSymbolName ( symbol : Symbol , enclosingDeclaration ?: Node ) {
40604060 let fullSymbolDisplayParts = symbolToDisplayParts ( typeChecker , symbol , enclosingDeclaration || sourceFile , /*meaning*/ undefined ,
40614061 SymbolFormatFlags . WriteTypeParametersOrArguments | SymbolFormatFlags . UseOnlyExternalAliasing ) ;
4062- displayParts . push . apply ( displayParts , fullSymbolDisplayParts ) ;
4062+ addRange ( displayParts , fullSymbolDisplayParts ) ;
40634063 }
40644064
40654065 function addPrefixForAnyFunctionOrVar ( symbol : Symbol , symbolKind : string ) {
@@ -4089,7 +4089,7 @@ namespace ts {
40894089 }
40904090
40914091 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 ) ) ;
40934093 if ( allSignatures . length > 1 ) {
40944094 displayParts . push ( spacePart ( ) ) ;
40954095 displayParts . push ( punctuationPart ( SyntaxKind . OpenParenToken ) ) ;
@@ -4106,7 +4106,7 @@ namespace ts {
41064106 let typeParameterParts = mapToDisplayParts ( writer => {
41074107 typeChecker . getSymbolDisplayBuilder ( ) . buildTypeParameterDisplayFromSymbol ( symbol , writer , enclosingDeclaration ) ;
41084108 } ) ;
4109- displayParts . push . apply ( displayParts , typeParameterParts ) ;
4109+ addRange ( displayParts , typeParameterParts ) ;
41104110 }
41114111 }
41124112
@@ -5620,7 +5620,7 @@ namespace ts {
56205620 // type to the search set
56215621 if ( isNameOfPropertyAssignment ( location ) ) {
56225622 forEach ( getPropertySymbolsFromContextualType ( location ) , contextualSymbol => {
5623- result . push . apply ( result , typeChecker . getRootSymbols ( contextualSymbol ) ) ;
5623+ addRange ( result , typeChecker . getRootSymbols ( contextualSymbol ) ) ;
56245624 } ) ;
56255625
56265626 /* Because in short-hand property assignment, location has two meaning : property name and as value of the property
0 commit comments