File: commentsFunction.symbols

package info (click to toggle)
node-typescript 2.1.5-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 203,952 kB
  • ctags: 52,987
  • sloc: sh: 11; makefile: 5
file content (109 lines) | stat: -rw-r--r-- 3,845 bytes parent folder | download | duplicates (2)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
=== tests/cases/compiler/commentsFunction.ts ===

/** This comment should appear for foo*/
function foo() {
>foo : Symbol(foo, Decl(commentsFunction.ts, 0, 0))

} /* trailing comment of function */
foo();
>foo : Symbol(foo, Decl(commentsFunction.ts, 0, 0))

/** This is comment for function signature*/
function fooWithParameters(/** this is comment about a*/a: string,
>fooWithParameters : Symbol(fooWithParameters, Decl(commentsFunction.ts, 4, 6))
>a : Symbol(a, Decl(commentsFunction.ts, 6, 27))

    /** this is comment for b*/
    b: number) {
>b : Symbol(b, Decl(commentsFunction.ts, 6, 66))

    var d = a;
>d : Symbol(d, Decl(commentsFunction.ts, 9, 7))
>a : Symbol(a, Decl(commentsFunction.ts, 6, 27))

} // trailing comment of function
fooWithParameters("a", 10);
>fooWithParameters : Symbol(fooWithParameters, Decl(commentsFunction.ts, 4, 6))

/** fooFunc
 * comment
 */
var fooFunc = function FooFunctionValue(/** fooFunctionValue param */ b: string) {
>fooFunc : Symbol(fooFunc, Decl(commentsFunction.ts, 15, 3))
>FooFunctionValue : Symbol(FooFunctionValue, Decl(commentsFunction.ts, 15, 13))
>b : Symbol(b, Decl(commentsFunction.ts, 15, 40))

    return b;
>b : Symbol(b, Decl(commentsFunction.ts, 15, 40))
}

/// lamdaFoo var comment
var lambdaFoo = /** this is lambda comment*/ (/**param a*/a: number, /**param b*/b: number) => a + b;
>lambdaFoo : Symbol(lambdaFoo, Decl(commentsFunction.ts, 20, 3))
>a : Symbol(a, Decl(commentsFunction.ts, 20, 46))
>b : Symbol(b, Decl(commentsFunction.ts, 20, 68))
>a : Symbol(a, Decl(commentsFunction.ts, 20, 46))
>b : Symbol(b, Decl(commentsFunction.ts, 20, 68))

var lambddaNoVarComment = /** this is lambda multiplication*/ (/**param a*/a: number, /**param b*/b: number) => a * b;
>lambddaNoVarComment : Symbol(lambddaNoVarComment, Decl(commentsFunction.ts, 21, 3))
>a : Symbol(a, Decl(commentsFunction.ts, 21, 63))
>b : Symbol(b, Decl(commentsFunction.ts, 21, 85))
>a : Symbol(a, Decl(commentsFunction.ts, 21, 63))
>b : Symbol(b, Decl(commentsFunction.ts, 21, 85))

lambdaFoo(10, 20);
>lambdaFoo : Symbol(lambdaFoo, Decl(commentsFunction.ts, 20, 3))

lambddaNoVarComment(10, 20);
>lambddaNoVarComment : Symbol(lambddaNoVarComment, Decl(commentsFunction.ts, 21, 3))

function blah(a: string /* multiline trailing comment 
>blah : Symbol(blah, Decl(commentsFunction.ts, 23, 28))
>a : Symbol(a, Decl(commentsFunction.ts, 25, 14))

multiline */) {
}

function blah2(a: string /* single line multiple trailing comments */ /* second */) {
>blah2 : Symbol(blah2, Decl(commentsFunction.ts, 27, 1))
>a : Symbol(a, Decl(commentsFunction.ts, 29, 15))
}

function blah3(a: string // trailing commen single line
>blah3 : Symbol(blah3, Decl(commentsFunction.ts, 30, 1))
>a : Symbol(a, Decl(commentsFunction.ts, 32, 15))

    ) {
}

lambdaFoo = (a, b) => a * b; // This is trailing comment
>lambdaFoo : Symbol(lambdaFoo, Decl(commentsFunction.ts, 20, 3))
>a : Symbol(a, Decl(commentsFunction.ts, 36, 13))
>b : Symbol(b, Decl(commentsFunction.ts, 36, 15))
>a : Symbol(a, Decl(commentsFunction.ts, 36, 13))
>b : Symbol(b, Decl(commentsFunction.ts, 36, 15))

/*leading comment*/() => 0; // Needs to be wrapped in parens to be a valid expression (not declaration)
/*leading comment*/(() => 0); //trailing comment

function blah4(/*1*/a: string/*2*/,/*3*/b: string/*4*/) {
>blah4 : Symbol(blah4, Decl(commentsFunction.ts, 39, 29))
>a : Symbol(a, Decl(commentsFunction.ts, 41, 15))
>b : Symbol(b, Decl(commentsFunction.ts, 41, 35))
}

function foo1() {
>foo1 : Symbol(foo1, Decl(commentsFunction.ts, 42, 1))

    // should emit this
}

function foo2() {
>foo2 : Symbol(foo2, Decl(commentsFunction.ts, 47, 1))

    /// This is some detached comment

    // should emit this leading comment of } too
}