-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the Babel plugin to remove empty static blocks
This commit updates the Babel plugin to: - apply the same flattening logic that we already have for blocks, to flatten blocks nested inside class static blocks - remove class static blocks when, after flattening all the blocks they contain, they are empty. Before this commit, the transform output was the same as the input.
- Loading branch information
1 parent
c60c0d1
commit 7513fb7
Showing
3 changed files
with
19 additions
and
1 deletion.
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
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,5 @@ | ||
class A { | ||
Check notice Code scanning / CodeQL Unused variable, import, function or class Note library
Unused class A.
|
||
static { | ||
foo(); | ||
} | ||
} |
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,9 @@ | ||
class A { | ||
Check notice Code scanning / CodeQL Unused variable, import, function or class Note library
Unused class A.
|
||
static {} | ||
static { | ||
{ foo() } | ||
} | ||
static { | ||
{;} | ||
} | ||
} |