|
1 | 1 | === tests/cases/conformance/es7/trailingCommasInFunctionParametersAndArguments.ts ===
|
| 2 | + |
2 | 3 | function f1(x,) {}
|
3 | 4 | >f1 : Symbol(f1, Decl(trailingCommasInFunctionParametersAndArguments.ts, 0, 0))
|
4 |
| ->x : Symbol(x, Decl(trailingCommasInFunctionParametersAndArguments.ts, 0, 12)) |
| 5 | +>x : Symbol(x, Decl(trailingCommasInFunctionParametersAndArguments.ts, 1, 12)) |
5 | 6 |
|
6 | 7 | f1(1,);
|
7 | 8 | >f1 : Symbol(f1, Decl(trailingCommasInFunctionParametersAndArguments.ts, 0, 0))
|
8 | 9 |
|
9 | 10 | function f2(...args,) {}
|
10 |
| ->f2 : Symbol(f2, Decl(trailingCommasInFunctionParametersAndArguments.ts, 2, 7)) |
11 |
| ->args : Symbol(args, Decl(trailingCommasInFunctionParametersAndArguments.ts, 4, 12)) |
| 11 | +>f2 : Symbol(f2, Decl(trailingCommasInFunctionParametersAndArguments.ts, 3, 7)) |
| 12 | +>args : Symbol(args, Decl(trailingCommasInFunctionParametersAndArguments.ts, 5, 12)) |
12 | 13 |
|
13 | 14 | f2(...[],);
|
14 |
| ->f2 : Symbol(f2, Decl(trailingCommasInFunctionParametersAndArguments.ts, 2, 7)) |
| 15 | +>f2 : Symbol(f2, Decl(trailingCommasInFunctionParametersAndArguments.ts, 3, 7)) |
15 | 16 |
|
16 | 17 | // Not confused by overloads
|
17 | 18 | declare function f3(x, ): number;
|
18 |
| ->f3 : Symbol(f3, Decl(trailingCommasInFunctionParametersAndArguments.ts, 6, 11), Decl(trailingCommasInFunctionParametersAndArguments.ts, 9, 33)) |
19 |
| ->x : Symbol(x, Decl(trailingCommasInFunctionParametersAndArguments.ts, 9, 20)) |
| 19 | +>f3 : Symbol(f3, Decl(trailingCommasInFunctionParametersAndArguments.ts, 7, 11), Decl(trailingCommasInFunctionParametersAndArguments.ts, 10, 33)) |
| 20 | +>x : Symbol(x, Decl(trailingCommasInFunctionParametersAndArguments.ts, 10, 20)) |
20 | 21 |
|
21 | 22 | declare function f3(x, y,): string;
|
22 |
| ->f3 : Symbol(f3, Decl(trailingCommasInFunctionParametersAndArguments.ts, 6, 11), Decl(trailingCommasInFunctionParametersAndArguments.ts, 9, 33)) |
23 |
| ->x : Symbol(x, Decl(trailingCommasInFunctionParametersAndArguments.ts, 10, 20)) |
24 |
| ->y : Symbol(y, Decl(trailingCommasInFunctionParametersAndArguments.ts, 10, 22)) |
| 23 | +>f3 : Symbol(f3, Decl(trailingCommasInFunctionParametersAndArguments.ts, 7, 11), Decl(trailingCommasInFunctionParametersAndArguments.ts, 10, 33)) |
| 24 | +>x : Symbol(x, Decl(trailingCommasInFunctionParametersAndArguments.ts, 11, 20)) |
| 25 | +>y : Symbol(y, Decl(trailingCommasInFunctionParametersAndArguments.ts, 11, 22)) |
25 | 26 |
|
26 | 27 | <number>f3(1,);
|
27 |
| ->f3 : Symbol(f3, Decl(trailingCommasInFunctionParametersAndArguments.ts, 6, 11), Decl(trailingCommasInFunctionParametersAndArguments.ts, 9, 33)) |
| 28 | +>f3 : Symbol(f3, Decl(trailingCommasInFunctionParametersAndArguments.ts, 7, 11), Decl(trailingCommasInFunctionParametersAndArguments.ts, 10, 33)) |
28 | 29 |
|
29 | 30 | <string>f3(1, 2,);
|
30 |
| ->f3 : Symbol(f3, Decl(trailingCommasInFunctionParametersAndArguments.ts, 6, 11), Decl(trailingCommasInFunctionParametersAndArguments.ts, 9, 33)) |
| 31 | +>f3 : Symbol(f3, Decl(trailingCommasInFunctionParametersAndArguments.ts, 7, 11), Decl(trailingCommasInFunctionParametersAndArguments.ts, 10, 33)) |
31 | 32 |
|
32 | 33 | // Works for constructors too
|
33 | 34 | class X {
|
34 |
| ->X : Symbol(X, Decl(trailingCommasInFunctionParametersAndArguments.ts, 13, 18)) |
| 35 | +>X : Symbol(X, Decl(trailingCommasInFunctionParametersAndArguments.ts, 14, 18)) |
35 | 36 |
|
36 | 37 | constructor(a,) { }
|
37 |
| ->a : Symbol(a, Decl(trailingCommasInFunctionParametersAndArguments.ts, 17, 16)) |
| 38 | +>a : Symbol(a, Decl(trailingCommasInFunctionParametersAndArguments.ts, 18, 16)) |
| 39 | + |
| 40 | + // See trailingCommasInGetter.ts |
| 41 | + set x(value,) { } |
| 42 | +>x : Symbol(X.x, Decl(trailingCommasInFunctionParametersAndArguments.ts, 18, 23)) |
| 43 | +>value : Symbol(value, Decl(trailingCommasInFunctionParametersAndArguments.ts, 20, 10)) |
38 | 44 | }
|
| 45 | +interface Y { |
| 46 | +>Y : Symbol(Y, Decl(trailingCommasInFunctionParametersAndArguments.ts, 21, 1)) |
| 47 | + |
| 48 | + new(x,); |
| 49 | +>x : Symbol(x, Decl(trailingCommasInFunctionParametersAndArguments.ts, 23, 8)) |
| 50 | + |
| 51 | + (x,); |
| 52 | +>x : Symbol(x, Decl(trailingCommasInFunctionParametersAndArguments.ts, 24, 5)) |
| 53 | +} |
| 54 | + |
39 | 55 | new X(1,);
|
40 |
| ->X : Symbol(X, Decl(trailingCommasInFunctionParametersAndArguments.ts, 13, 18)) |
| 56 | +>X : Symbol(X, Decl(trailingCommasInFunctionParametersAndArguments.ts, 14, 18)) |
41 | 57 |
|
0 commit comments