-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Disallow decorator in array pattern #17159
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
Disallow decorator in array pattern #17159
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/58791 |
@@ -0,0 +1 @@ | |||
var [@foo foo ] = foo; |
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.
For stage 3 decorators, currently Babel throws a recoverable error message "Decorators cannot be used to decorate parameters.", which is quite confusing. Here we throw an unrecoverable error since we already do that for object patterns.
d2701df
to
eda0d82
Compare
* type cleanup * fix: disallow decorator in array pattern * copy test cases to stage 3 decorators * rename parseAssignableListItem to parseBindingElement * incorrect test setup
var [@foo foo ] = foo;
as decorator within an array pattern, which is not allowed.Spot this issue when browsing through the
lval
implementation.