CARVIEW |
Select Language
HTTP/2 200
date: Tue, 22 Jul 2025 09:07:43 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-repository-download: git clone https://github.com/microsoft/TypeScript.git
etag: W/"9d4ac50bf9366fb63761a2471dce497c"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=rg7ulD6y3nuJ31Uxq2uOGGlmFLdVBm9bszCTXWjNBx1zdJeX15XG9Xi2GalmdrJ3Uq2RSQBHFPjaL77ikmTJ39SKq8SboQubSyJXodB9ASu5iZwxe6I3QNCgNyNXDsi8VlNTS7Uav0vMhs3owkVftchYq6BC8xHUgKTCeshW9aF9Eet93czLSeqQA3%2FEVPQ%2F2iZwZb28T44%2FScw%2Fjx%2Fw4vhcooITNOuKZp7If5IOnV0dx9i6yfoMrM5VQA858DiyXstRRlqrpcwoeWxHWp2xHg%3D%3D--GK92I%2FjrRzg%2B4%2Bkn--75Ky5RYSPMIJAupHYbDI2A%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.66313305.1753175260; Path=/; Domain=github.com; Expires=Wed, 22 Jul 2026 09:07:40 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Wed, 22 Jul 2026 09:07:40 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: E1D8:1160FB:41D2CF:498114:687F54DC
Created a branded type for identifier-escaped strings (#16915) · microsoft/TypeScript@4e6b2f3 · GitHub
Dismiss banner
Copy file name to clipboardExpand all lines: src/compiler/commandLineParser.ts
Copy file name to clipboardExpand all lines: src/compiler/transformers/destructuring.ts
Copy file name to clipboardExpand all lines: src/compiler/transformers/es2015.ts
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit 4e6b2f3
authored
Created a branded type for identifier-escaped strings (#16915)
* Created a branded type for escaped strings
Then flowed it throughout the compiler, finding and fixing a handful of
bugs relating to underscore-prefixed identifiers in the process.
Includes a test for two cases noticed - diagnostics from conflicting
symbols from export *'s, and enum with underscore prefixed member emit.
* Correctly double underscores WRT mapped types
* Add fourslash tests for other fixed issues
* use function call over cast
* Update forEachEntry type accuracy
* Just use escaped names for ActiveLabel
* Remove casts from getPropertyNameForPropertyNameNode
* This pattern has occurred a few times, could use a helper function.
* Remove duplicated helper
* Remove unneeded check, use helper
* Identifiers list is no longer escaped strings
* Extract repeated string-getting code into helper
* Rename type and associated functions
* Make getName() return UnderscoreEscapedString, add getUnescapedName()
* Add list of internal symbol names to escaped string type to cut back on casting
* Remove outdated comments
* Reassign interned values to nodes, just in case
* Swap to string enum
* Add deprecated aliases to escapeIdentifier and unescapeIdentifier
* Add temp var
* Remove unsafe casts
* Rename escaped string type as per @sandersn's suggestion, fix string enum usages
* Reorganize double underscore tests
* Remove jfreeman from TODO
* Remove unneeded parenthesis1 parent ad291d9 commit 4e6b2f3Copy full SHA for 4e6b2f3
File tree
Expand file treeCollapse file tree
63 files changed
+1206
-514
lines changedFilter options
- src
- compiler
- transformers
- module
- services
- codefixes
- refactors
- tests
- baselines/reference
- cases
- compiler
- fourslash
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Expand file treeCollapse file tree
63 files changed
+1206
-514
lines changed+54-53Lines changed: 54 additions & 53 deletions
Large diffs are not rendered by default.
+250-251Lines changed: 250 additions & 251 deletions
Large diffs are not rendered by default.
src/compiler/commandLineParser.ts
Copy file name to clipboardExpand all lines: src/compiler/commandLineParser.ts+1-1Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1047 | 1047 |
| |
1048 | 1048 |
| |
1049 | 1049 |
| |
1050 |
| - | |
| 1050 | + | |
1051 | 1051 |
| |
1052 | 1052 |
| |
1053 | 1053 |
| |
|
+35-11Lines changed: 35 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
47 | 47 |
| |
48 | 48 |
| |
49 | 49 |
| |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
50 | 66 |
| |
51 | 67 |
| |
52 | 68 |
| |
| |||
1000 | 1016 |
| |
1001 | 1017 |
| |
1002 | 1018 |
| |
1003 |
| - | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
1004 | 1022 |
| |
1005 | 1023 |
| |
1006 | 1024 |
| |
1007 |
| - | |
| 1025 | + | |
1008 | 1026 |
| |
1009 | 1027 |
| |
1010 | 1028 |
| |
| |||
1013 | 1031 |
| |
1014 | 1032 |
| |
1015 | 1033 |
| |
1016 |
| - | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
1017 | 1037 |
| |
1018 | 1038 |
| |
1019 |
| - | |
| 1039 | + | |
1020 | 1040 |
| |
1021 | 1041 |
| |
1022 | 1042 |
| |
| |||
1025 | 1045 |
| |
1026 | 1046 |
| |
1027 | 1047 |
| |
1028 |
| - | |
1029 |
| - | |
1030 |
| - | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
1031 | 1053 |
| |
1032 | 1054 |
| |
1033 | 1055 |
| |
| |||
1099 | 1121 |
| |
1100 | 1122 |
| |
1101 | 1123 |
| |
1102 |
| - | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
1103 | 1127 |
| |
1104 |
| - | |
| 1128 | + | |
1105 | 1129 |
| |
1106 | 1130 |
| |
1107 | 1131 |
| |
| |||
2272 | 2296 |
| |
2273 | 2297 |
| |
2274 | 2298 |
| |
2275 |
| - | |
| 2299 | + | |
2276 | 2300 |
| |
2277 | 2301 |
| |
2278 | 2302 |
| |
2279 | 2303 |
| |
2280 | 2304 |
| |
2281 |
| - | |
| 2305 | + | |
2282 | 2306 |
| |
2283 | 2307 |
| |
2284 | 2308 |
| |
|
+6-6Lines changed: 6 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2761 | 2761 |
| |
2762 | 2762 |
| |
2763 | 2763 |
| |
2764 |
| - | |
| 2764 | + | |
2765 | 2765 |
| |
2766 | 2766 |
| |
2767 | 2767 |
| |
| |||
2818 | 2818 |
| |
2819 | 2819 |
| |
2820 | 2820 |
| |
2821 |
| - | |
| 2821 | + | |
2822 | 2822 |
| |
2823 | 2823 |
| |
2824 | 2824 |
| |
2825 | 2825 |
| |
2826 | 2826 |
| |
2827 |
| - | |
| 2827 | + | |
2828 | 2828 |
| |
2829 | 2829 |
| |
2830 | 2830 |
| |
| |||
2843 | 2843 |
| |
2844 | 2844 |
| |
2845 | 2845 |
| |
2846 |
| - | |
| 2846 | + | |
2847 | 2847 |
| |
2848 | 2848 |
| |
2849 | 2849 |
| |
| |||
2918 | 2918 |
| |
2919 | 2919 |
| |
2920 | 2920 |
| |
2921 |
| - | |
| 2921 | + | |
2922 | 2922 |
| |
2923 | 2923 |
| |
2924 | 2924 |
| |
| |||
2981 | 2981 |
| |
2982 | 2982 |
| |
2983 | 2983 |
| |
2984 |
| - | |
| 2984 | + | |
2985 | 2985 |
| |
2986 | 2986 |
| |
2987 | 2987 |
| |
|
+5-5Lines changed: 5 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
99 | 99 |
| |
100 | 100 |
| |
101 | 101 |
| |
102 |
| - | |
| 102 | + | |
103 | 103 |
| |
104 | 104 |
| |
105 | 105 |
| |
| |||
112 | 112 |
| |
113 | 113 |
| |
114 | 114 |
| |
115 |
| - | |
| 115 | + | |
116 | 116 |
| |
117 | 117 |
| |
118 | 118 |
| |
| |||
124 | 124 |
| |
125 | 125 |
| |
126 | 126 |
| |
127 |
| - | |
| 127 | + | |
128 | 128 |
| |
129 | 129 |
| |
130 | 130 |
| |
| |||
2645 | 2645 |
| |
2646 | 2646 |
| |
2647 | 2647 |
| |
2648 |
| - | |
| 2648 | + | |
2649 | 2649 |
| |
2650 | 2650 |
| |
2651 | 2651 |
| |
2652 | 2652 |
| |
2653 |
| - | |
| 2653 | + | |
2654 | 2654 |
| |
2655 | 2655 |
| |
2656 | 2656 |
| |
|
+15-13Lines changed: 15 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1178 | 1178 |
| |
1179 | 1179 |
| |
1180 | 1180 |
| |
1181 |
| - | |
| 1181 | + | |
1182 | 1182 |
| |
1183 | 1183 |
| |
1184 | 1184 |
| |
1185 | 1185 |
| |
1186 |
| - | |
1187 | 1186 |
| |
1188 | 1187 |
| |
1189 | 1188 |
| |
| |||
1203 | 1202 |
| |
1204 | 1203 |
| |
1205 | 1204 |
| |
1206 |
| - | |
| 1205 | + | |
1207 | 1206 |
| |
1208 | 1207 |
| |
1209 | 1208 |
| |
| |||
1227 | 1226 |
| |
1228 | 1227 |
| |
1229 | 1228 |
| |
1230 |
| - | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
1231 | 1232 |
| |
1232 | 1233 |
| |
1233 | 1234 |
| |
| |||
2049 | 2050 |
| |
2050 | 2051 |
| |
2051 | 2052 |
| |
2052 |
| - | |
2053 |
| - | |
| 2053 | + | |
| 2054 | + | |
2054 | 2055 |
| |
2055 | 2056 |
| |
2056 | 2057 |
| |
2057 |
| - | |
| 2058 | + | |
2058 | 2059 |
| |
2059 | 2060 |
| |
2060 | 2061 |
| |
2061 | 2062 |
| |
2062 | 2063 |
| |
2063 |
| - | |
| 2064 | + | |
2064 | 2065 |
| |
2065 | 2066 |
| |
2066 | 2067 |
| |
2067 | 2068 |
| |
2068 |
| - | |
| 2069 | + | |
2069 | 2070 |
| |
2070 | 2071 |
| |
2071 |
| - | |
| 2072 | + | |
2072 | 2073 |
| |
2073 | 2074 |
| |
2074 | 2075 |
| |
| |||
5624 | 5625 |
| |
5625 | 5626 |
| |
5626 | 5627 |
| |
5627 |
| - | |
| 5628 | + | |
| 5629 | + | |
5628 | 5630 |
| |
5629 | 5631 |
| |
5630 | 5632 |
| |
| |||
5768 | 5770 |
| |
5769 | 5771 |
| |
5770 | 5772 |
| |
5771 |
| - | |
| 5773 | + | |
5772 | 5774 |
| |
5773 | 5775 |
| |
5774 | 5776 |
| |
| |||
6990 | 6992 |
| |
6991 | 6993 |
| |
6992 | 6994 |
| |
6993 |
| - | |
| 6995 | + | |
6994 | 6996 |
| |
6995 | 6997 |
| |
6996 | 6998 |
| |
|
+2-2Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
405 | 405 |
| |
406 | 406 |
| |
407 | 407 |
| |
408 |
| - | |
| 408 | + | |
409 | 409 |
| |
410 | 410 |
| |
411 | 411 |
| |
| |||
580 | 580 |
| |
581 | 581 |
| |
582 | 582 |
| |
583 |
| - | |
| 583 | + | |
584 | 584 |
| |
585 | 585 |
| |
586 | 586 |
| |
|
src/compiler/transformers/destructuring.ts
Copy file name to clipboardExpand all lines: src/compiler/transformers/destructuring.ts+2-2Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
411 | 411 |
| |
412 | 412 |
| |
413 | 413 |
| |
414 |
| - | |
| 414 | + | |
415 | 415 |
| |
416 | 416 |
| |
417 | 417 |
| |
418 |
| - | |
| 418 | + | |
419 | 419 |
| |
420 | 420 |
| |
421 | 421 |
| |
|
src/compiler/transformers/es2015.ts
Copy file name to clipboardExpand all lines: src/compiler/transformers/es2015.ts+6-6Lines changed: 6 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
661 | 661 |
| |
662 | 662 |
| |
663 | 663 |
| |
664 |
| - | |
| 664 | + | |
665 | 665 |
| |
666 | 666 |
| |
667 | 667 |
| |
| |||
680 | 680 |
| |
681 | 681 |
| |
682 | 682 |
| |
683 |
| - | |
| 683 | + | |
684 | 684 |
| |
685 | 685 |
| |
686 | 686 |
| |
687 |
| - | |
| 687 | + | |
688 | 688 |
| |
689 | 689 |
| |
690 | 690 |
| |
| |||
2236 | 2236 |
| |
2237 | 2237 |
| |
2238 | 2238 |
| |
2239 |
| - | |
| 2239 | + | |
2240 | 2240 |
| |
2241 | 2241 |
| |
2242 | 2242 |
| |
2243 |
| - | |
| 2243 | + | |
2244 | 2244 |
| |
2245 | 2245 |
| |
2246 | 2246 |
| |
| |||
3053 | 3053 |
| |
3054 | 3054 |
| |
3055 | 3055 |
| |
3056 |
| - | |
| 3056 | + | |
3057 | 3057 |
| |
3058 | 3058 |
| |
3059 | 3059 |
| |
|
You can’t perform that action at this time.
0 commit comments