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 {
@@ -4804,6 +4799,11 @@ namespace ts {
4804
4799
return undefined ;
4805
4800
}
4806
4801
4802
+ /** Add an extra underscore to identifiers that start with two underscores to avoid issues with magic names like '__proto__' */
4803
+ export function escapeLeadingUnderscores ( identifier : string ) : __String {
4804
+ return ( identifier . length >= 2 && identifier . charCodeAt ( 0 ) === CharacterCodes . _ && identifier . charCodeAt ( 1 ) === CharacterCodes . _ ? "_" + identifier : identifier ) as __String ;
4805
+ }
4806
+
4807
4807
/**
4808
4808
* Remove extra underscore from escaped identifier text content.
4809
4809
*
Original file line number Diff line number Diff line change @@ -3190,6 +3190,8 @@ declare namespace ts {
3190
3190
* @returns The original parse tree node if found; otherwise, undefined.
3191
3191
*/
3192
3192
function getParseTreeNode < T extends Node > ( node : Node | undefined , nodeTest ?: ( node : Node ) => node is T ) : T | undefined ;
3193
+ /** Add an extra underscore to identifiers that start with two underscores to avoid issues with magic names like '__proto__' */
3194
+ function escapeLeadingUnderscores ( identifier : string ) : __String ;
3193
3195
/**
3194
3196
* Remove extra underscore from escaped identifier text content.
3195
3197
*
Original file line number Diff line number Diff line change @@ -3190,6 +3190,8 @@ declare namespace ts {
3190
3190
* @returns The original parse tree node if found; otherwise, undefined.
3191
3191
*/
3192
3192
function getParseTreeNode < T extends Node > ( node : Node | undefined , nodeTest ?: ( node : Node ) => node is T ) : T | undefined ;
3193
+ /** Add an extra underscore to identifiers that start with two underscores to avoid issues with magic names like '__proto__' */
3194
+ function escapeLeadingUnderscores ( identifier : string ) : __String ;
3193
3195
/**
3194
3196
* Remove extra underscore from escaped identifier text content.
3195
3197
*
You can’t perform that action at this time.
0 commit comments