-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Description
Describe the bug
When target is es2022 and keepClassNames is enabled, the static property of a class that uses a decorator uses the wrong class name when referencing its own other static property.
Also, as I tested, the tranform result is as expected in all of the following options:
- target: es2022, keepClassNames: false
- target: es2021, keepClassNames: true
- target: es2021, keepClassNames: false
Input code
No response
Config
No response
Playground link
SWC Info output
No response
Expected behavior
The Class referenced by the static property in Cls4, Cls5 should be Cls4, Cls5 respectively:
...
let Cls4 = class Cls4 {
static NAME = Cls4.name;
name = Cls4.name;
getName() {
return Cls4.NAME;
}
};
Cls4 = _ts_decorate([
Decorator()
], Cls4);
let Cls5 = class Cls5 {
static NAME = Cls5.name;
name = Cls5.name;
};
Cls5 = _ts_decorate([
Decorator()
], Cls5);
...
Actual behavior
No response
Version
1.3.90
Additional context
No response
falkenhawk