File: forwardRefInClassProperties.js

package info (click to toggle)
node-typescript 3.3.3333-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 324,548 kB
  • sloc: makefile: 6; sh: 3
file content (31 lines) | stat: -rw-r--r-- 741 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//// [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]
var Test = /** @class */ (function () {
    function Test() {
        this._b = this._a; // undefined, no error/warning
        this._a = 3;
    }
    Test.prototype.method = function () {
        var a = b; // Property 'b' is used before its initialization.
        var b = 3;
    };
    Test._B = Test._A; // undefined, no error/warning
    Test._A = 3;
    return Test;
}());