File: argumentsAsPropertyName.symbols

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 (43 lines) | stat: -rw-r--r-- 1,855 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
32
33
34
35
36
37
38
39
40
41
42
43
=== tests/cases/compiler/argumentsAsPropertyName.ts ===
// target: es5
type MyType = {
>MyType : Symbol(MyType, Decl(argumentsAsPropertyName.ts, 0, 0))

    arguments: Array<string>
>arguments : Symbol(arguments, Decl(argumentsAsPropertyName.ts, 1, 15))
>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
}

declare function use(s: any);
>use : Symbol(use, Decl(argumentsAsPropertyName.ts, 3, 1))
>s : Symbol(s, Decl(argumentsAsPropertyName.ts, 5, 21))

function myFunction(myType: MyType) {
>myFunction : Symbol(myFunction, Decl(argumentsAsPropertyName.ts, 5, 29))
>myType : Symbol(myType, Decl(argumentsAsPropertyName.ts, 7, 20))
>MyType : Symbol(MyType, Decl(argumentsAsPropertyName.ts, 0, 0))

    for (let i = 0; i < 10; i++) {
>i : Symbol(i, Decl(argumentsAsPropertyName.ts, 8, 12))
>i : Symbol(i, Decl(argumentsAsPropertyName.ts, 8, 12))
>i : Symbol(i, Decl(argumentsAsPropertyName.ts, 8, 12))

        use(myType.arguments[i]);
>use : Symbol(use, Decl(argumentsAsPropertyName.ts, 3, 1))
>myType.arguments : Symbol(arguments, Decl(argumentsAsPropertyName.ts, 1, 15))
>myType : Symbol(myType, Decl(argumentsAsPropertyName.ts, 7, 20))
>arguments : Symbol(arguments, Decl(argumentsAsPropertyName.ts, 1, 15))
>i : Symbol(i, Decl(argumentsAsPropertyName.ts, 8, 12))

        // create closure so that tsc will turn loop body into function
        const x = 5;
>x : Symbol(x, Decl(argumentsAsPropertyName.ts, 11, 13))

        [1, 2, 3].forEach(function(j) { use(x); })
>[1, 2, 3].forEach : Symbol(Array.forEach, Decl(lib.es5.d.ts, --, --))
>forEach : Symbol(Array.forEach, Decl(lib.es5.d.ts, --, --))
>j : Symbol(j, Decl(argumentsAsPropertyName.ts, 12, 35))
>use : Symbol(use, Decl(argumentsAsPropertyName.ts, 3, 1))
>x : Symbol(x, Decl(argumentsAsPropertyName.ts, 11, 13))
    }
}