mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
34 lines
736 B
TypeScript
34 lines
736 B
TypeScript
//// [tests/cases/compiler/forwardRefInClassProperties.ts] ////
|
|
|
|
//// [forwardRefInClassProperties.ts]
|
|
class Test
|
|
{
|
|
_b = this._a; // undefined, no error/warning
|
|
_a = 3;
|
|
|
|
static _B = Test._A; // undefined, no error/warning
|
|
static _A = 3;
|
|
|
|
method()
|
|
{
|
|
let a = b; // Property 'b' is used before its initialization.
|
|
let b = 3;
|
|
}
|
|
}
|
|
|
|
|
|
//// [forwardRefInClassProperties.js]
|
|
"use strict";
|
|
class Test {
|
|
constructor() {
|
|
this._b = this._a; // undefined, no error/warning
|
|
this._a = 3;
|
|
}
|
|
method() {
|
|
let a = b; // Property 'b' is used before its initialization.
|
|
let b = 3;
|
|
}
|
|
}
|
|
Test._B = Test._A; // undefined, no error/warning
|
|
Test._A = 3;
|