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
Parse static blocks with typescript plugin #13243
Parse static blocks with typescript plugin #13243
Conversation
sosukesuzuki
commented
May 1, 2021
•
edited by gitpod-io
bot
edited by gitpod-io
bot
Q | A |
---|---|
Fixed Issues? | Fixes #13234 |
Patch: Bug Fix? | Y |
Tests Added + Pass? | Yes |
License | MIT |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit a334b8f:
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/45805/ |
@@ -0,0 +1,3 @@ | |||
class Foo { | |||
static private {} |
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 can report a better error, like Static class blocks cannot have any modifier
@@ -131,6 +131,8 @@ const TSErrors = makeErrorTemplates( | |||
"A 'set' accessor cannot have rest parameter.", | |||
SetAccesorCannotHaveReturnType: | |||
"A 'set' accessor cannot have a return type annotation.", | |||
StaticBlockCannotHaveanyModifier: |
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.
StaticBlockCannotHaveanyModifier: | |
StaticBlockCannotHaveModifier: |
nit-picking: I prefer shorter error codes.
@@ -0,0 +1,4 @@ | |||
class Foo { | |||
static 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.
As I read the name of the test, did you mean
static foo; | |
static static; |
?
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.
LGTM with some comments.
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.
Can you add a test case on static static {}
? I think it should throw static block can not have static modifier.
This comment has been minimized.
This comment has been minimized.
7cc5d28
to
a334b8f
Compare