Skip to content
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

[Bug] Static initialization block not recognized (results in SyntaxError) #189

Open
SolutionsInBalance opened this issue Aug 26, 2024 · 1 comment
Assignees
Labels
Type: Bug Something isn't working as expected.

Comments

@SolutionsInBalance
Copy link

🐞 Bug Report

Describe the bug

If a Static Initialization Block is used in a class definition, this results in an error: "SyntaxError: Unexpected token: punc ({) "
See for the definition of a static initialization block: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Static_initialization_blocks


Is this a regression?

Not tested in previous version.

To Reproduce

  1. Copy the following code to a new file (code example taken from the Mozilla site referred to above):

class ClassWithStaticInitializationBlock {
static staticProperty1 = 'Property 1';
static staticProperty2;
static {
this.staticProperty2 = 'Property 2';
}
}
console.log(ClassWithStaticInitializationBlock.staticProperty1);
// Expected output: "Property 1"
console.log(ClassWithStaticInitializationBlock.staticProperty2);
// Expected output: "Property 2"

  1. Save the file
  2. Try to minify the file
  3. See resulting error in VS Code output window (output from Extension host)

Expected behaviour

class ClassWithStaticInitializationBlock{static staticProperty1="Property 1";static staticProperty2="Property 2"}
*


Media prove


Your environment

  • OS: Windows 11 Pro (23H2) build 22631
  • MinifyAll version: 2.10.0
  • Visual Studio Code version: 1.92.2

Additional context

@SolutionsInBalance SolutionsInBalance added the Type: Bug Something isn't working as expected. label Aug 26, 2024
Copy link

welcome bot commented Aug 26, 2024

Thanks for opening your first issue in Josee9988/project-template! Be sure to follow the issue template and provide every bit of information to help the developers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working as expected.
Projects
None yet
Development

No branches or pull requests

2 participants