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
fix(babel-parser): delete static
property from class static block for TS
#13680
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a18637b
Delete static modifier from static blocks node
sosukesuzuki cb5bff3
Update tests
sosukesuzuki 801aa8e
Address review
sosukesuzuki 7fc070d
Address review
sosukesuzuki 5ea75b9
Add tests from review
sosukesuzuki 828b241
Add tests
sosukesuzuki File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
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
3 changes: 3 additions & 0 deletions
3
...ures/typescript/static-blocks/invalid-static-block-with-accessibility-private-01/input.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class Foo { | ||
private static {} | ||
} |
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
File renamed without changes.
12 changes: 12 additions & 0 deletions
12
.../typescript/static-blocks/invalid-static-block-with-accessibility-private-02/options.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"plugins": [ | ||
[ | ||
"classStaticBlock" | ||
], | ||
[ | ||
"typescript" | ||
] | ||
], | ||
"sourceType": "module", | ||
"throws": "Unexpected token (2:17)" | ||
} |
3 changes: 3 additions & 0 deletions
3
...es/typescript/static-blocks/invalid-static-block-with-accessibility-protected-01/input.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class Foo { | ||
protected static {} | ||
} |
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
File renamed without changes.
12 changes: 12 additions & 0 deletions
12
...ypescript/static-blocks/invalid-static-block-with-accessibility-protected-02/options.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"plugins": [ | ||
[ | ||
"classStaticBlock" | ||
], | ||
[ | ||
"typescript" | ||
] | ||
], | ||
"sourceType": "module", | ||
"throws": "Unexpected token (2:19)" | ||
} |
3 changes: 3 additions & 0 deletions
3
...tures/typescript/static-blocks/invalid-static-block-with-accessibility-public-01/input.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class Foo { | ||
public static {} | ||
} |
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
File renamed without changes.
12 changes: 12 additions & 0 deletions
12
...s/typescript/static-blocks/invalid-static-block-with-accessibility-public-02/options.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"plugins": [ | ||
[ | ||
"classStaticBlock" | ||
], | ||
[ | ||
"typescript" | ||
] | ||
], | ||
"sourceType": "module", | ||
"throws": "Unexpected token (2:16)" | ||
} |
File renamed without changes.
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
3 changes: 3 additions & 0 deletions
3
...fixtures/typescript/static-blocks/invalid-static-block-with-modifier-abstract-02/input.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class Foo { | ||
static abstract {} | ||
} |
12 changes: 12 additions & 0 deletions
12
...ures/typescript/static-blocks/invalid-static-block-with-modifier-abstract-02/options.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"plugins": [ | ||
[ | ||
"classStaticBlock" | ||
], | ||
[ | ||
"typescript" | ||
] | ||
], | ||
"sourceType": "module", | ||
"throws": "Unexpected token (2:18)" | ||
} |
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
...atic-block-with-modifier-override-01/invalid-static-block-with-modifier-abstract/input.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class Foo { | ||
abstract static {} | ||
} |
38 changes: 38 additions & 0 deletions
38
...c-block-with-modifier-override-01/invalid-static-block-with-modifier-abstract/output.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"type": "File", | ||
"start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, | ||
"errors": [ | ||
"SyntaxError: Static class blocks cannot have any modifier. (2:20)" | ||
], | ||
"program": { | ||
"type": "Program", | ||
"start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, | ||
"sourceType": "module", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "ClassDeclaration", | ||
"start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, | ||
"id": { | ||
"type": "Identifier", | ||
"start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9},"identifierName":"Foo"}, | ||
"name": "Foo" | ||
}, | ||
"superClass": null, | ||
"body": { | ||
"type": "ClassBody", | ||
"start":10,"end":34,"loc":{"start":{"line":1,"column":10},"end":{"line":3,"column":1}}, | ||
"body": [ | ||
{ | ||
"type": "StaticBlock", | ||
"start":14,"end":32,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":20}}, | ||
"abstract": true, | ||
"body": [] | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |
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
3 changes: 3 additions & 0 deletions
3
...fixtures/typescript/static-blocks/invalid-static-block-with-modifier-override-02/input.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class Foo { | ||
static override {} | ||
} |
12 changes: 12 additions & 0 deletions
12
...ures/typescript/static-blocks/invalid-static-block-with-modifier-override-02/options.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"plugins": [ | ||
[ | ||
"classStaticBlock" | ||
], | ||
[ | ||
"typescript" | ||
] | ||
], | ||
"sourceType": "module", | ||
"throws": "Unexpected token (2:18)" | ||
} |
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
File renamed without changes.
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
3 changes: 3 additions & 0 deletions
3
.../fixtures/typescript/static-blocks/invalid-static-blocks-with-modifer-declare-02/input.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class Foo { | ||
static declare {} | ||
} |
12 changes: 12 additions & 0 deletions
12
...tures/typescript/static-blocks/invalid-static-blocks-with-modifer-declare-02/options.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"plugins": [ | ||
[ | ||
"classStaticBlock" | ||
], | ||
[ | ||
"typescript" | ||
] | ||
], | ||
"sourceType": "module", | ||
"throws": "Unexpected token (2:17)" | ||
} |
File renamed without changes.
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
3 changes: 3 additions & 0 deletions
3
...ixtures/typescript/static-blocks/invalid-static-blocks-with-modifier-readonly-02/input.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class Foo { | ||
static readonly {} | ||
} |
12 changes: 12 additions & 0 deletions
12
...res/typescript/static-blocks/invalid-static-blocks-with-modifier-readonly-02/options.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"plugins": [ | ||
[ | ||
"classStaticBlock" | ||
], | ||
[ | ||
"typescript" | ||
] | ||
], | ||
"sourceType": "module", | ||
"throws": "Unexpected token (2:18)" | ||
} |
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.
This is a regression, the input is
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.
@JLHwung Can you review again?