File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed
tests/baselines/reference/api Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -563,11 +563,6 @@ namespace ts {
563
563
return isString ( value ) ? '"' + escapeNonAsciiString ( value ) + '"' : "" + value ;
564
564
}
565
565
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
-
571
566
// Make an identifier from an external module name by extracting the string after the last "/" and replacing
572
567
// all non-alphanumeric characters with underscores
573
568
export function makeIdentifierFromModuleName ( moduleName : string ) : string {
@@ -4792,6 +4787,11 @@ namespace ts {
4792
4787
return undefined ;
4793
4788
}
4794
4789
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
+
4795
4795
/**
4796
4796
* Remove extra underscore from escaped identifier text content.
4797
4797
*
Original file line number Diff line number Diff line change @@ -3184,6 +3184,8 @@ declare namespace ts {
3184
3184
* @returns The original parse tree node if found; otherwise, undefined.
3185
3185
*/
3186
3186
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 ;
3187
3189
/**
3188
3190
* Remove extra underscore from escaped identifier text content.
3189
3191
*
Original file line number Diff line number Diff line change @@ -3184,6 +3184,8 @@ declare namespace ts {
3184
3184
* @returns The original parse tree node if found; otherwise, undefined.
3185
3185
*/
3186
3186
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 ;
3187
3189
/**
3188
3190
* Remove extra underscore from escaped identifier text content.
3189
3191
*
You can’t perform that action at this time.
0 commit comments