Skip to content

allow BindingPattern in BindingRestElement#26008

Merged
mhegazy merged 1 commit into
microsoft:masterfrom
ajafff:restbindingpattern
Jul 31, 2018
Merged

allow BindingPattern in BindingRestElement#26008
mhegazy merged 1 commit into
microsoft:masterfrom
ajafff:restbindingpattern

Conversation

@ajafff
Copy link
Copy Markdown
Contributor

@ajafff ajafff commented Jul 27, 2018

Part of #6275

Downlevel emit already works as expected. Those baselines were not changed.
Just to make sure, here's an example in the playground: https://agentcooper.github.io/typescript-play/?target=1#code/CYUwxgNghgTiAEEQBd7IK4AckC54G0BnZGASwDsBzAGnnPQFsAjEGWpgew6SnIF0A3ACgkqfFFoA6afiZTpAbwAMeMAF8+feAF40WJAKA

Comment thread src/compiler/checker.ts
}
checkGrammarForDisallowedTrailingComma(elements, Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma);

if (node.name.kind === SyntaxKind.ArrayBindingPattern || node.name.kind === SyntaxKind.ObjectBindingPattern) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note that this never checked BindingRestProperty because that has a parse error: https://agentcooper.github.io/typescript-play/#code/DYUwLgBA3gdHUF8EQLzQQGmnGBtAusmogNxA

@mhegazy mhegazy requested a review from weswigham July 30, 2018 18:57
@mhegazy
Copy link
Copy Markdown
Contributor

mhegazy commented Jul 30, 2018

@weswigham can you please review

@mhegazy mhegazy merged commit 114cd80 into microsoft:master Jul 31, 2018
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants