-
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
Computed properties (but not known symbols) #1752
Merged
Merged
Changes from 25 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
15187e5
Enable computed properties
JsonFreeman d192fea
Switch checkObjectLiteral to iterate over element declarations
JsonFreeman ef06879
Create symbols for computed properties
JsonFreeman 7192767
Add type checking for computed properties in object literals
JsonFreeman 4ac2b4b
Add tests for object literals with computed properties
JsonFreeman 4c0122d
Move computed property checks so that they will be checked in classes…
JsonFreeman de3eb36
Update baselines
JsonFreeman 96b5f1f
Add tests for classes, methods, accessors with computed properties
JsonFreeman 4c5db71
Remove some unnecessary TODOs
JsonFreeman 1b35a1b
Contextual typing for computed properties
JsonFreeman 1973b42
Indexers in object literals include computed property types
JsonFreeman f943f6c
Adjust error numbers
JsonFreeman 4cc2722
Disallow this in computed properties in classes
JsonFreeman e317767
Consolidate getSuperContainer
JsonFreeman b5349a5
Disallow super and fix this capturing for computed properties
JsonFreeman 89f36bb
Disallow computed properties referencing type parameters from contain…
JsonFreeman 85219ee
Check computed properties against indexers in classes
JsonFreeman 26da378
Move subroutine function to the bottom of checkIndexConstraints
JsonFreeman eb7798f
Skip computed properties on declaration emit
JsonFreeman de5aa6c
Fix source map scope name for computed properties
JsonFreeman b022ccd
Merge branch 'master' into computedProperties
JsonFreeman 768d818
Fix error message wording
JsonFreeman eeb4dc4
Merge branch 'master' into computedProperties
JsonFreeman f7a8ba2
Use isTypeOfKind in computed property checks
JsonFreeman 12fc418
Make isNumericComputedName call checkComputedPropertyName
JsonFreeman 4a7aa7e
Address CR feedback
JsonFreeman 9c9434b
Merge branch 'master' into computedProperties
JsonFreeman bd29ca8
Merge branch 'master' into computedProperties
JsonFreeman 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
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.
So ensure that either it does not have a computed name OR if it does, it has a symbol? I'm confused.
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.
OR that it has no name!
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.
Would it be better to invent a term for this, and put a doc comment above the function that defines the term? I could call it a dynamic name
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 should discuss this; @yuit and I think that the "But" is a problem - it's just "And" but it indicates something that is contradictory in intuition.
hasDynamicName is not bad for starters
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.
Ok, I will change that. You're right, "but" is bad.