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
Rephrase parser error message #11208
Conversation
The codecov error is a false negative. This time codecov returns different HTTP code when a repository token secret is not available. This one returns 400 (expected) https://github.com/babel/babel/pull/11201/checks?check_run_id=483631598#step:6:37 This one returns some code other than 400 I will add an empty commit tomorrow to see if it is fixed. |
UnsupportedParameterDecorator: | ||
"Stage 2 decorators cannot be used to decorate parameters", | ||
"Decorators cannot be used to decorate parameters", |
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.
Actually, legacy
decorators can be used to decorate parameters. (for TS)
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 think it is okay because this error is not visible to users if they are using legacy
decorators. Like we did in "Legacy octal literals are not allowed in strict mode", if an error is thrown on a legacy elements, we should prefix its name. Otherwise we are referring to the latest proposal.
// todo: merge with Errors.StrictOctalLiteral | ||
"Legacy octal literals are not allowed in strict mode", | ||
); | ||
this.raise(start, Errors.StrictOctalLiteral); |
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.
Here we might want to change the StrictOctalLiteral
message, because 0o1
is perfectly valid in strict mode.
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.
Yeah, 0o1
is octal literal but not legacy octal literals. I have changed StrictOctalLiteral
to be "Legacy octal literals are not allowed in strict mode".
@kaicataldo FYI, this probably conflicts with your PR. |
2a59a6e
to
74bc15f
Compare
74bc15f
to
4a79c1e
Compare
Co-Authored-By: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
Co-Authored-By: Brian Ng <bng412@gmail.com>
ae77e40
to
9d032b5
Compare
Rephrase some parser error messages and resolve todos introduced in #11192 . PTAL and comment if you have any ideas. 🙏
(Yes we will do todos)