…asses
This change fixes the static blocks transform to be compatible with the
TC39 proposal that would make frozen classes throw when adding private
fields (https://github.com/tc39/proposal-nonextensible-applies-to-private).
When a class has static private properties, trailing static blocks (those
that come after all static fields) are now deferred to execute after the
class definition is complete. This ensures that even if a static block
freezes the class, no new private fields will be attempted to be added
afterward.
Example transformation:
```js
// Input
class C {
static #foo = 1;
static { Object.freeze(this); }
}
// Output
var _initStaticBlock0;
class C {
static #foo = 1;
static #_ = _initStaticBlock0 = () => {
Object.freeze(this);
};
}
_initStaticBlock0.call(C);
```
Closes #10956
Co-authored-by: Donny/강동윤 <[email protected]>
This change fixes the static blocks transform to be compatible with the TC39 proposal that would make frozen classes throw when adding private fields.
Closes #10956
Generated with Claude Code