Skip to content

Commit ce00997

Browse files
Added symbols files.
1 parent 13c3129 commit ce00997

16 files changed

+280
-0
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments01_ES6.ts ===
2+
var a = () => {
3+
>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 0, 3))
4+
5+
var arg = arguments[0]; // error
6+
>arg : Symbol(arg, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 1, 7))
7+
>arguments : Symbol(arguments)
8+
}
9+
10+
var b = function () {
11+
>b : Symbol(b, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 4, 3))
12+
13+
var a = () => {
14+
>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 5, 7))
15+
16+
var arg = arguments[0]; // error
17+
>arg : Symbol(arg, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 6, 11))
18+
>arguments : Symbol(arguments)
19+
}
20+
}
21+
22+
function baz() {
23+
>baz : Symbol(baz, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 8, 1))
24+
25+
() => {
26+
var arg = arguments[0];
27+
>arg : Symbol(arg, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 12, 5))
28+
>arguments : Symbol(arguments)
29+
}
30+
}
31+
32+
function foo(inputFunc: () => void) { }
33+
>foo : Symbol(foo, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 14, 1))
34+
>inputFunc : Symbol(inputFunc, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 16, 13))
35+
36+
foo(() => {
37+
>foo : Symbol(foo, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 14, 1))
38+
39+
var arg = arguments[0]; // error
40+
>arg : Symbol(arg, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 18, 7))
41+
>arguments : Symbol(arguments)
42+
43+
});
44+
45+
function bar() {
46+
>bar : Symbol(bar, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 19, 3))
47+
48+
var arg = arguments[0]; // no error
49+
>arg : Symbol(arg, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 22, 7))
50+
>arguments : Symbol(arguments)
51+
}
52+
53+
54+
() => {
55+
function foo() {
56+
>foo : Symbol(foo, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 26, 7))
57+
58+
var arg = arguments[0]; // no error
59+
>arg : Symbol(arg, Decl(emitArrowFunctionWhenUsingArguments01_ES6.ts, 28, 5))
60+
>arguments : Symbol(arguments)
61+
}
62+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments02_ES6.ts ===
2+
3+
var a = () => arguments;
4+
>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments02_ES6.ts, 1, 3))
5+
>arguments : Symbol(arguments)
6+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments03_ES6.ts ===
2+
3+
var arguments;
4+
>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments03_ES6.ts, 1, 3))
5+
6+
var a = () => arguments;
7+
>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments03_ES6.ts, 2, 3))
8+
>arguments : Symbol(arguments)
9+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments04_ES6.ts ===
2+
3+
function f() {
4+
>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments04_ES6.ts, 0, 0))
5+
6+
var arguments;
7+
>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments04_ES6.ts, 2, 7))
8+
9+
var a = () => arguments;
10+
>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments04_ES6.ts, 3, 7))
11+
>arguments : Symbol(arguments)
12+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments05_ES6.ts ===
2+
3+
function f(arguments) {
4+
>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments05_ES6.ts, 0, 0))
5+
>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments05_ES6.ts, 1, 11))
6+
7+
var a = () => arguments;
8+
>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments05_ES6.ts, 2, 7))
9+
>arguments : Symbol(arguments)
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments06_ES6.ts ===
2+
3+
function f(arguments) {
4+
>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments06_ES6.ts, 0, 0))
5+
>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments06_ES6.ts, 1, 11))
6+
7+
var a = () => () => arguments;
8+
>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments06_ES6.ts, 2, 7))
9+
>arguments : Symbol(arguments)
10+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments07_ES6.ts ===
2+
3+
function f(arguments) {
4+
>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments07_ES6.ts, 0, 0))
5+
>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments07_ES6.ts, 1, 11))
6+
7+
var a = (arguments) => () => arguments;
8+
>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments07_ES6.ts, 2, 7))
9+
>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments07_ES6.ts, 2, 13))
10+
>arguments : Symbol(arguments)
11+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments09_ES6.ts ===
2+
3+
function f(_arguments) {
4+
>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments09_ES6.ts, 0, 0))
5+
>_arguments : Symbol(_arguments, Decl(emitArrowFunctionWhenUsingArguments09_ES6.ts, 1, 11))
6+
7+
var a = () => () => arguments;
8+
>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments09_ES6.ts, 2, 7))
9+
>arguments : Symbol(arguments)
10+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments10_ES6.ts ===
2+
3+
function f() {
4+
>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments10_ES6.ts, 0, 0))
5+
6+
var _arguments = 10;
7+
>_arguments : Symbol(_arguments, Decl(emitArrowFunctionWhenUsingArguments10_ES6.ts, 2, 7))
8+
9+
var a = () => () => arguments;
10+
>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments10_ES6.ts, 3, 7))
11+
>arguments : Symbol(arguments)
12+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments11_ES6.ts ===
2+
3+
function f(arguments) {
4+
>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments11_ES6.ts, 0, 0))
5+
>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments11_ES6.ts, 1, 11))
6+
7+
var _arguments = 10;
8+
>_arguments : Symbol(_arguments, Decl(emitArrowFunctionWhenUsingArguments11_ES6.ts, 2, 7))
9+
10+
var a = () => () => arguments;
11+
>a : Symbol(a, Decl(emitArrowFunctionWhenUsingArguments11_ES6.ts, 3, 7))
12+
>arguments : Symbol(arguments)
13+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments14_ES6.ts ===
2+
3+
function f() {
4+
>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments14_ES6.ts, 0, 0))
5+
6+
if (Math.random()) {
7+
>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38))
8+
>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1664, 1))
9+
>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38))
10+
11+
let arguments = 100;
12+
>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments14_ES6.ts, 3, 11))
13+
14+
return () => arguments;
15+
>arguments : Symbol(arguments)
16+
}
17+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments15_ES6.ts ===
2+
3+
function f() {
4+
>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments15_ES6.ts, 0, 0))
5+
6+
var arguments = "hello";
7+
>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments15_ES6.ts, 2, 7))
8+
9+
if (Math.random()) {
10+
>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38))
11+
>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1664, 1))
12+
>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38))
13+
14+
const arguments = 100;
15+
>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments15_ES6.ts, 4, 13))
16+
17+
return () => arguments;
18+
>arguments : Symbol(arguments)
19+
}
20+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments16_ES6.ts ===
2+
3+
function f() {
4+
>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments16_ES6.ts, 0, 0))
5+
6+
var arguments = "hello";
7+
>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments16_ES6.ts, 2, 7), Decl(emitArrowFunctionWhenUsingArguments16_ES6.ts, 6, 7))
8+
9+
if (Math.random()) {
10+
>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38))
11+
>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1664, 1))
12+
>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38))
13+
14+
return () => arguments[0];
15+
>arguments : Symbol(arguments)
16+
}
17+
var arguments = "world";
18+
>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments16_ES6.ts, 2, 7), Decl(emitArrowFunctionWhenUsingArguments16_ES6.ts, 6, 7))
19+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments17_ES6.ts ===
2+
3+
function f() {
4+
>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments17_ES6.ts, 0, 0))
5+
6+
var { arguments } = { arguments: "hello" };
7+
>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments17_ES6.ts, 2, 9), Decl(emitArrowFunctionWhenUsingArguments17_ES6.ts, 6, 7))
8+
>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments17_ES6.ts, 2, 25))
9+
10+
if (Math.random()) {
11+
>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38))
12+
>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1664, 1))
13+
>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38))
14+
15+
return () => arguments[0];
16+
>arguments : Symbol(arguments)
17+
}
18+
var arguments = "world";
19+
>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments17_ES6.ts, 2, 9), Decl(emitArrowFunctionWhenUsingArguments17_ES6.ts, 6, 7))
20+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments18_ES6.ts ===
2+
3+
function f() {
4+
>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments18_ES6.ts, 0, 0))
5+
6+
var { arguments: args } = { arguments };
7+
>args : Symbol(args, Decl(emitArrowFunctionWhenUsingArguments18_ES6.ts, 2, 9))
8+
>arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments18_ES6.ts, 2, 31))
9+
10+
if (Math.random()) {
11+
>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38))
12+
>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1664, 1))
13+
>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38))
14+
15+
return () => arguments;
16+
>arguments : Symbol(arguments)
17+
}
18+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
=== tests/cases/conformance/es6/arrowFunction/emitArrowFunctionWhenUsingArguments19_ES6.ts ===
2+
3+
function f() {
4+
>f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments19_ES6.ts, 0, 0))
5+
6+
function g() {
7+
>g : Symbol(g, Decl(emitArrowFunctionWhenUsingArguments19_ES6.ts, 1, 14))
8+
9+
var _arguments = 10; // No capture in 'g', so no conflict.
10+
>_arguments : Symbol(_arguments, Decl(emitArrowFunctionWhenUsingArguments19_ES6.ts, 3, 11))
11+
12+
function h() {
13+
>h : Symbol(h, Decl(emitArrowFunctionWhenUsingArguments19_ES6.ts, 3, 28))
14+
15+
var capture = () => arguments; // Should trigger an '_arguments' capture into function 'h'
16+
>capture : Symbol(capture, Decl(emitArrowFunctionWhenUsingArguments19_ES6.ts, 5, 15))
17+
>arguments : Symbol(arguments)
18+
19+
foo(_arguments); // Error as this does not resolve to the user defined '_arguments'
20+
>foo : Symbol(foo, Decl(emitArrowFunctionWhenUsingArguments19_ES6.ts, 8, 5))
21+
>_arguments : Symbol(_arguments, Decl(emitArrowFunctionWhenUsingArguments19_ES6.ts, 3, 11))
22+
}
23+
}
24+
25+
function foo(x: any) {
26+
>foo : Symbol(foo, Decl(emitArrowFunctionWhenUsingArguments19_ES6.ts, 8, 5))
27+
>x : Symbol(x, Decl(emitArrowFunctionWhenUsingArguments19_ES6.ts, 10, 17))
28+
29+
return 100;
30+
}
31+
}

0 commit comments

Comments
 (0)