-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Created a branded type for identifier-escaped strings #16915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
042a78d
Created a branded type for escaped strings
weswigham ce4018c
Correctly double underscores WRT mapped types
weswigham 342ec75
Add fourslash tests for other fixed issues
weswigham 770010e
Merge branch 'master' into escaped-string-type
weswigham 1f55366
use function call over cast
weswigham 4411889
Update forEachEntry type accuracy
weswigham 47f7fbd
Just use escaped names for ActiveLabel
weswigham 7f22f39
Remove casts from getPropertyNameForPropertyNameNode
weswigham f88f21a
This pattern has occurred a few times, could use a helper function.
weswigham af30041
Remove duplicated helper
weswigham 5d9ea3a
Remove unneeded check, use helper
weswigham 352c13d
Identifiers list is no longer escaped strings
weswigham b371e7a
Extract repeated string-getting code into helper
weswigham ba0071e
Rename type and associated functions
weswigham e0c7dcc
Make getName() return UnderscoreEscapedString, add getUnescapedName()
weswigham 50a8c04
Add list of internal symbol names to escaped string type to cut back …
weswigham 3398d41
Remove outdated comments
weswigham a4bd2ab
Reassign interned values to nodes, just in case
weswigham 0967927
Swap to string enum
weswigham e99b679
Add deprecated aliases to escapeIdentifier and unescapeIdentifier
weswigham 3383d8a
Add temp var
weswigham 5eca8a3
Remove unsafe casts
weswigham 9424f14
Rename escaped string type as per @sandersn's suggestion, fix string …
weswigham 23032d4
Reorganize double underscore tests
weswigham 008532d
Remove jfreeman from TODO
weswigham 5e6b69a
Remove unneeded parenthesis
weswigham File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
internIdentifier used to escape before interning. Now the code interns, then escapes. Is this correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is correct for how we use the
identifiers
map theinternIdentifier
function uses (namely, looking for collisions in generated identifiers).