File tree Expand file tree Collapse file tree
tests/baselines/reference/api Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -563,11 +563,6 @@ namespace ts {
563563 return isString ( value ) ? '"' + escapeNonAsciiString ( value ) + '"' : "" + value ;
564564 }
565565
566- // Add an extra underscore to identifiers that start with two underscores to avoid issues with magic names like '__proto__'
567- export function escapeLeadingUnderscores ( identifier : string ) : __String {
568- return ( identifier . length >= 2 && identifier . charCodeAt ( 0 ) === CharacterCodes . _ && identifier . charCodeAt ( 1 ) === CharacterCodes . _ ? "_" + identifier : identifier ) as __String ;
569- }
570-
571566 // Make an identifier from an external module name by extracting the string after the last "/" and replacing
572567 // all non-alphanumeric characters with underscores
573568 export function makeIdentifierFromModuleName ( moduleName : string ) : string {
@@ -4792,6 +4787,11 @@ namespace ts {
47924787 return undefined ;
47934788 }
47944789
4790+ /** Add an extra underscore to identifiers that start with two underscores to avoid issues with magic names like '__proto__' */
4791+ export function escapeLeadingUnderscores ( identifier : string ) : __String {
4792+ return ( identifier . length >= 2 && identifier . charCodeAt ( 0 ) === CharacterCodes . _ && identifier . charCodeAt ( 1 ) === CharacterCodes . _ ? "_" + identifier : identifier ) as __String ;
4793+ }
4794+
47954795 /**
47964796 * Remove extra underscore from escaped identifier text content.
47974797 *
Original file line number Diff line number Diff line change @@ -3184,6 +3184,8 @@ declare namespace ts {
31843184 * @returns The original parse tree node if found; otherwise, undefined.
31853185 */
31863186 function getParseTreeNode < T extends Node > ( node : Node | undefined , nodeTest ?: ( node : Node ) => node is T ) : T | undefined ;
3187+ /** Add an extra underscore to identifiers that start with two underscores to avoid issues with magic names like '__proto__' */
3188+ function escapeLeadingUnderscores ( identifier : string ) : __String ;
31873189 /**
31883190 * Remove extra underscore from escaped identifier text content.
31893191 *
Original file line number Diff line number Diff line change @@ -3184,6 +3184,8 @@ declare namespace ts {
31843184 * @returns The original parse tree node if found; otherwise, undefined.
31853185 */
31863186 function getParseTreeNode < T extends Node > ( node : Node | undefined , nodeTest ?: ( node : Node ) => node is T ) : T | undefined ;
3187+ /** Add an extra underscore to identifiers that start with two underscores to avoid issues with magic names like '__proto__' */
3188+ function escapeLeadingUnderscores ( identifier : string ) : __String ;
31873189 /**
31883190 * Remove extra underscore from escaped identifier text content.
31893191 *
You can’t perform that action at this time.
0 commit comments