-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
ES private class elements #42458
Merged
rbuckton
merged 87 commits into
microsoft:master
from
bloomberg:es-private-methods-and-accessors
Mar 25, 2021
Merged
ES private class elements #42458
Changes from 86 commits
Commits
Show all changes
87 commits
Select commit
Hold shift + click to select a range
e3a3fb8
Added support for private identifier methods.
dragomirtitian 4ab27a2
Added tests for private methods.
dragomirtitian 6977b9f
Added check to only not allow private name method signatures in anyth…
dragomirtitian bc8c07e
Added private accessors tests
dragomirtitian 2760ed8
Transform private methods
mkubilayk 04af85d
Rename shouldTransformPrivateFields
mkubilayk f048d72
Accept baseline
mkubilayk f8cfb81
Use a single WeakSet for brand-check
mkubilayk 4aa4c3b
Accept baseline
mkubilayk 0ac1271
Add a test for using private methods in static field initializers
mkubilayk 7da5bd9
Add breaking checker test
mkubilayk e133f60
Add to instances once per-instance
mkubilayk aa5dd8a
Accept baseline
mkubilayk a3889a7
fix: evaluate receiver and rhs expressions before throwing on readonl…
mkubilayk 8952caa
Add a test for evaluating rhs before readonly assignment
mkubilayk dee87bb
Transpile private accessors
mkubilayk aec7e9b
Accept baseline
mkubilayk f3bbf0f
fix: handle readonly/writeonly accessors
mkubilayk a1b59cd
accept baseline
mkubilayk 6b74498
add a test for private setter without a getter
mkubilayk d51f6cd
fix: getAllUnscopedEmitHelpers
mkubilayk c175770
fix: better handling of duplicate names
mkubilayk 4301af5
Fixed wrong error message for private methods in class expressions.
dragomirtitian 3a056b2
change error message
mkubilayk 95df2d1
add a test for async private methods with a higher target
mkubilayk 590124e
fix: setter assignment returns rhs value
mkubilayk 219ea83
add a test for setter assignment return value
mkubilayk 25da8ca
fix: handle duplicate accessors
mkubilayk a2228be
add tests for duplicate accessors
mkubilayk ff4f737
docs: add missing parameter docs
mkubilayk 704727c
Fixed failing test.
dragomirtitian 73925dc
baseline-accept: ordering changes
mkubilayk 67fd38d
fix: attach weakSetName to property declaration
mkubilayk 45c2a41
add a test for nested private methods
mkubilayk 356b91d
add a test with any
mkubilayk b391464
Merge pull request #51 from bloomberg/fix/nested-private-methods
dragomirtitian 5ebb3d6
Added support for static private fields accessors and methods.
dragomirtitian 7006c09
Added error message for private identifiers used with static decorato…
dragomirtitian b876613
Fixed emit static bug that used private names outside of classes for …
dragomirtitian 31a8c00
Added tests for private static fields methods and accessors.
dragomirtitian 9219e99
Merge remote-tracking branch 'remotes/origin/master' into es-private-…
dragomirtitian 5a27a32
Merge remote-tracking branch 'remotes/bloomberg/es-private-methods-an…
dragomirtitian 964fc27
Fixed error messages and tests after merge.
dragomirtitian d2ab6fc
Merge branch 'es-private-methods-and-accessors' into es-private-stati…
dragomirtitian 23f6c67
Accept new baseline.
dragomirtitian 374e6f3
Improved duplicate identifier checks for static private class elements.
dragomirtitian 62b4f2f
Added error when using initializers with private static fields when u…
dragomirtitian b2a692d
Fixed code review issues.
dragomirtitian 363041e
Removed semantically wrong emit on `useDefineForClassFields:true` wit…
dragomirtitian 64757e0
Changed emit for uninitialized private static fields.
dragomirtitian 68a7f80
Added runtime error in helper if a static private field is accessed b…
dragomirtitian 7e7b0b1
Fixed code review comments for private identifier static class elements.
dragomirtitian 30c7f69
add debug.assertNever for unknown node type (#53)
mkubilayk c924058
Merge remote-tracking branch 'upstream/master' into es-private-method…
mkubilayk e65116f
Merge remote-tracking branch 'upstream/master' into es-private-method…
mkubilayk 4748c87
Fixed code review issues.
dragomirtitian 09a5aae
Merge branch 'es-private-methods-and-accessors' into es-private-stati…
dragomirtitian 497e47f
Fixed code review issues for private class elements.
dragomirtitian 294cc48
Fixes class shadowing when checking access to a private static class …
dragomirtitian 027bdb3
Merge remote-tracking branch 'remotes/origin/master' into es-private-…
dragomirtitian 7bbc944
Merge remote-tracking branch 'upstream/master'
mkubilayk dd526e7
fix private methods/accessors in class expr inside a loop
mkubilayk f6ecfab
collapse switch case
mkubilayk 6c3f661
fix class name
mkubilayk ef69c6c
simplify getPrivateMethodsAndAccessors
mkubilayk 2a646ed
remove findPreviousAccessorInfo
mkubilayk d8136f7
lazily create weakSetName identifier
mkubilayk fbd749c
Merge remote-tracking branch 'remotes/bloomberg/es-private-static-fie…
dragomirtitian f96eafe
Merge remote-tracking branch 'remotes/bloomberg/es-private-static-fie…
dragomirtitian 2de8a43
Merge branch 'es-private-methods-and-accessors' of https://github.com…
dragomirtitian 7490a36
do not allocate a node if not needed in visitMehodDeclaration (#55)
mkubilayk c273258
Removed all the emit helpers for private identifier methods accessors…
dragomirtitian 1addbb3
Simplified emit for private identifier class elements.
dragomirtitian c461b92
do not clone the receiver (#57)
mkubilayk a61fd5f
leave bad code in for #constructor and duplicate private names (#58)
mkubilayk 89f746a
Added check for WeakSet collision.
dragomirtitian ff24636
Added error for using a set only accessor.
dragomirtitian a60e429
Merge pull request #61 from bloomberg/es-private-methods-and-accessor…
dragomirtitian f5816ab
update keyof tests and ?? (#62)
mkubilayk 3b62d3c
fix emit helpers comments
mkubilayk 7d8a2b9
produce an error if private field helpers are not up to date
mkubilayk d0d2055
add tests
mkubilayk 93a7ca3
fix setter-only compound assignment
mkubilayk 6da2cdd
Merge pull request #63 from bloomberg/helper-parameter-count
mkubilayk 30805b7
fix tests
mkubilayk 8d77a8e
fix duplicated trailing comments (#64)
mkubilayk 8078ae0
clear receiver pos and setTextRange on helper calls
mkubilayk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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 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.
We may need a test in checker that verifies the parameter count of
__classPrivateFieldGet
and__classPrivateFieldSet
using the .d.ts we ship with tslib to verify you're using an up-to-date version of tslib.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.
I see
checkExternalEmitHelpers
is used to check the existence of helpers. Were you thinking an extension to that, which would validate the parameter count forExternalEmitHelpers.ClassPrivateFieldGet | ExternalEmitHelpers.ClassPrivateFieldSet
?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.
Added this in 7d8a2b9.
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.
That's precisely what I was describing, yes.