You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
🐞 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
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"
Expected behaviour
class ClassWithStaticInitializationBlock{static staticProperty1="Property 1";static staticProperty2="Property 2"}
*
Media prove
Your environment
Additional context
The text was updated successfully, but these errors were encountered: