1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

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.
This commit is contained in:
Nicolò Ribaudo 2024-08-05 14:35:54 +02:00
parent c60c0d1c6d
commit 995f5a29aa
No known key found for this signature in database
GPG key ID: AAFDA9101C58F338
3 changed files with 33 additions and 1 deletions

View file

@ -0,0 +1,20 @@
class A {
static {}
static {
{ foo() }
}
static {
{;}
}
static {
if (PDFJSDev.test('TRUE')) {
var a = 0;
}
}
static {
if (PDFJSDev.test('FALSE')) {
var a = 1;
}
}
}