mirror of
https://github.com/swc-project/swc.git
synced 2024-12-21 04:32:01 +03:00
32 lines
900 B
TypeScript
32 lines
900 B
TypeScript
|
// @target: ES5
|
||
|
// no errors
|
||
|
|
||
|
class C {
|
||
|
protected x: string;
|
||
|
protected get y() { return this.x; }
|
||
|
protected set y(x) { this.y = this.x; }
|
||
|
protected foo() { return this.foo; }
|
||
|
|
||
|
protected static x: string;
|
||
|
protected static get y() { return this.x; }
|
||
|
protected static set y(x) { this.y = this.x; }
|
||
|
protected static foo() { return this.foo; }
|
||
|
protected static bar() { this.foo(); }
|
||
|
}
|
||
|
|
||
|
// added level of function nesting
|
||
|
class C2 {
|
||
|
protected x: string;
|
||
|
protected get y() { () => this.x; return null; }
|
||
|
protected set y(x) { () => { this.y = this.x; } }
|
||
|
protected foo() { () => this.foo; }
|
||
|
|
||
|
protected static x: string;
|
||
|
protected static get y() { () => this.x; return null; }
|
||
|
protected static set y(x) {
|
||
|
() => { this.y = this.x; }
|
||
|
}
|
||
|
protected static foo() { () => this.foo; }
|
||
|
protected static bar() { () => this.foo(); }
|
||
|
}
|