File: anonterface.types

package info (click to toggle)
node-typescript 5.0.4%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 459,116 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (43 lines) | stat: -rw-r--r-- 866 bytes parent folder | download | duplicates (7)
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/anonterface.ts ===
module M {
>M : typeof M

    export class C {
>C : C

        m(fn:{ (n:number):string; },n2:number):string {
>m : (fn: (n: number) => string, n2: number) => string
>fn : (n: number) => string
>n : number
>n2 : number

            return fn(n2);
>fn(n2) : string
>fn : (n: number) => string
>n2 : number
        }
    }
}

var c=new M.C();
>c : M.C
>new M.C() : M.C
>M.C : typeof M.C
>M : typeof M
>C : typeof M.C

c.m(function(n) { return "hello: "+n; },18);
>c.m(function(n) { return "hello: "+n; },18) : string
>c.m : (fn: (n: number) => string, n2: number) => string
>c : M.C
>m : (fn: (n: number) => string, n2: number) => string
>function(n) { return "hello: "+n; } : (n: number) => string
>n : number
>"hello: "+n : string
>"hello: " : "hello: "
>n : number
>18 : 18