Files
7e13d30e73 [static blocks] Do not inject new static fields after static code (#17443)
* [static blocks] Do not inject new static fields after static code

* Update fixtures

* Less parentheses

* Avoid temp variable

* Preserve class name

* Fix Babel 8

* Fix ts

* fix ts again

* harden new-target test

* Fix old Babel 7 compat

---------

Co-authored-by: Huáng Jùnliàng <[email protected]>
2025-07-28 15:25:17 -04:00

20 lines
356 B
JavaScript

let Foo = class {
static {
expect(this.name).toBe("Foo");
if (false) use(this);
}
};
let obj = {
["someName"]: class {
static x = expect(this.name).toBe("someName");
static {
if (false) use(this);
expect(this.name).toBe("someName");
}
}
};
expect(Foo.name).toBe("Foo");
expect(obj.someName.name).toBe("someName");