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 {
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 {
@@ -4804,6 +4799,11 @@ namespace ts {
48044799 return undefined ;
48054800 }
48064801
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+
48074807 /**
48084808 * Remove extra underscore from escaped identifier text content.
48094809 *
Original file line number Diff line number Diff line change @@ -3190,6 +3190,8 @@ declare namespace ts {
31903190 * @returns The original parse tree node if found; otherwise, undefined.
31913191 */
31923192 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 ;
31933195 /**
31943196 * Remove extra underscore from escaped identifier text content.
31953197 *
Original file line number Diff line number Diff line change @@ -3190,6 +3190,8 @@ declare namespace ts {
31903190 * @returns The original parse tree node if found; otherwise, undefined.
31913191 */
31923192 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 ;
31933195 /**
31943196 * Remove extra underscore from escaped identifier text content.
31953197 *
You can’t perform that action at this time.
0 commit comments