-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Destructuring #1346
Merged
Merged
Destructuring #1346
Changes from 31 commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
86f290f
Initial parser support for destructuring patterns
ahejlsberg a01b440
Rework tracking and error reporting related to widening of types
ahejlsberg 2d3752e
Merge branch 'master' into destructuring
ahejlsberg 3d3212b
Adding binding patterns to declaration names
ahejlsberg af00c71
End-to-end support for destructuring in variable declarations
ahejlsberg 3cda261
Rudimentary support in language service
ahejlsberg bd65f16
Parser errors for destructuring declarations
ahejlsberg a6401bb
Adding destructuring variable declaration error messages
ahejlsberg 7840f0d
Moving error reporting to getWidenedTypeForVariableDeclaration
ahejlsberg 850f3cb
Destructuring parameter declarations
ahejlsberg 2ed5f41
Destructuring of tuple type cannot specify extra variables
ahejlsberg 58c3c2f
Merge branch 'master' into destructuring
ahejlsberg d39749f
Adding SyntaxKind.FunctionType/ConstructorType to isAnyFunction
ahejlsberg 607140b
Support for destructuring assignments
ahejlsberg 38a2640
Propagate node kind in variable/parameter destructuring declarations
ahejlsberg 6b96386
Allow string or numeric literal as property name of object binding
ahejlsberg 8ed1f24
Fine tuning array and tuple type checks in destructuring
ahejlsberg d8ecd8c
Fixed bug in union type identity comparison
ahejlsberg 98eaca5
Accepting new baselines
ahejlsberg cf3e3ac
Rewriting and emit for destructuring declarations
ahejlsberg 28a73bc
Emit of rest parameter for loop uses unique temporary variable name
ahejlsberg ec7ce72
Removing unused diagnostics related to '_i' variable name
ahejlsberg 501a370
Accepting new baselines
ahejlsberg 3ff2a62
Allow assignment expressions as destructuring assignment target
ahejlsberg 9e63911
Emit for destructuring assignments
ahejlsberg ab35da9
Baseline changes from updating rest parameter emit to use new tempora…
ahejlsberg 7994e90
Emit for destructuring parameter declarations
ahejlsberg 0731a28
Support exported destructuring variable declarations
ahejlsberg dc39de1
Removing fourslash test that no longer applies
ahejlsberg ecfcb9d
Fixing fourslash test
ahejlsberg 65d1510
Adding rudimentary tests
ahejlsberg 816abb1
Merge branch 'master' into destructuring
ahejlsberg b49e277
Addressing CR feedback
ahejlsberg 4118ffc
Accepting new baselines
ahejlsberg 05c9966
Addressing CR feedback:
ahejlsberg b3dffff
Addressing a bit more CR feedback
ahejlsberg 459dee0
Merge branch 'master' into destructuring
ahejlsberg 7bc35b3
Merge branch 'master' into destructuring
ahejlsberg 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.
out of curiosity, how can you have a parameter that has a binding pattern name, whose parent is also a binding pattern? Thanks!
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.
By writing a nested binding pattern, for example:
Here, the parameter nodes with binding pattern names
[a, b]
and[c, d]
both have a binding pattern parent.