Skip to content

Commit 38b7757

Browse files
committed
Tests for iterationMode=iterable
1 parent 32bcc97 commit 38b7757

File tree

65 files changed

+3617
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+3617
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
tests/cases/conformance/statements/for-ofStatements/ES5For-of33.ts(2,5): error TS2304: Cannot find name 'console'.
2+
3+
4+
==== tests/cases/conformance/statements/for-ofStatements/ES5For-of33.ts (1 errors) ====
5+
for (var v of ['a', 'b', 'c']) {
6+
console.log(v);
7+
~~~~~~~
8+
!!! error TS2304: Cannot find name 'console'.
9+
}

tests/baselines/reference/ES5For-of33.js

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/baselines/reference/ES5For-of33.js.map

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
===================================================================
2+
JsFile: ES5For-of33.js
3+
mapUrl: ES5For-of33.js.map
4+
sourceRoot:
5+
sources: ES5For-of33.ts
6+
===================================================================
7+
-------------------------------------------------------------------
8+
emittedFile:tests/cases/conformance/statements/for-ofStatements/ES5For-of33.js
9+
sourceFile:ES5For-of33.ts
10+
-------------------------------------------------------------------
11+
>>>var __values = (this && this.__values) || function (o) { return (i = typeof Symbol === "function" && o[Symbol.iterator] || 0) ? i.call(o) : { next: function () { return { done: d = d || i >= o.length, value: d ? void 0 : o[i++] }; } }; var i, d; };
12+
>>>var __step = (this && this.__step) || function (r) { return !(r.done || (r.done = (r.result = r.iterator.next()).done)); };
13+
>>>var __close = (this && this.__close) || function (r) { return (m = !(r && r.done) && r.iterator["return"]) && m.call(r.iterator); var m; };
14+
>>>try {
15+
>>> for (var iterator_1 = { iterator: __values(['a', 'b', 'c']) }; __step(iterator_1);) {
16+
1 >^^^^
17+
2 > ^^^
18+
3 > ^
19+
4 > ^
20+
5 > ^^^^
21+
6 > ^^^^^^^^^^^^^
22+
7 > ^^
23+
8 > ^^^^^^^^^^
24+
9 > ^^^^^^^^^
25+
10> ^
26+
11> ^^^
27+
12> ^^
28+
13> ^^^
29+
14> ^^
30+
15> ^^^
31+
16> ^
32+
17> ^
33+
18> ^^
34+
19> ^^
35+
20> ^^^^^^^^^^^^^^^^^^
36+
1 >
37+
2 > for
38+
3 >
39+
4 > (var v of
40+
5 >
41+
6 >
42+
7 >
43+
8 >
44+
9 >
45+
10> [
46+
11> 'a'
47+
12> ,
48+
13> 'b'
49+
14> ,
50+
15> 'c'
51+
16> ]
52+
17>
53+
18>
54+
19>
55+
20> var v
56+
1 >Emitted(5, 5) Source(1, 1) + SourceIndex(0)
57+
2 >Emitted(5, 8) Source(1, 4) + SourceIndex(0)
58+
3 >Emitted(5, 9) Source(1, 5) + SourceIndex(0)
59+
4 >Emitted(5, 10) Source(1, 15) + SourceIndex(0)
60+
5 >Emitted(5, 14) Source(1, 15) + SourceIndex(0)
61+
6 >Emitted(5, 27) Source(1, 15) + SourceIndex(0)
62+
7 >Emitted(5, 29) Source(1, 15) + SourceIndex(0)
63+
8 >Emitted(5, 39) Source(1, 15) + SourceIndex(0)
64+
9 >Emitted(5, 48) Source(1, 15) + SourceIndex(0)
65+
10>Emitted(5, 49) Source(1, 16) + SourceIndex(0)
66+
11>Emitted(5, 52) Source(1, 19) + SourceIndex(0)
67+
12>Emitted(5, 54) Source(1, 21) + SourceIndex(0)
68+
13>Emitted(5, 57) Source(1, 24) + SourceIndex(0)
69+
14>Emitted(5, 59) Source(1, 26) + SourceIndex(0)
70+
15>Emitted(5, 62) Source(1, 29) + SourceIndex(0)
71+
16>Emitted(5, 63) Source(1, 30) + SourceIndex(0)
72+
17>Emitted(5, 64) Source(1, 30) + SourceIndex(0)
73+
18>Emitted(5, 66) Source(1, 30) + SourceIndex(0)
74+
19>Emitted(5, 68) Source(1, 6) + SourceIndex(0)
75+
20>Emitted(5, 86) Source(1, 11) + SourceIndex(0)
76+
---
77+
>>> var v = iterator_1.result.value;
78+
1 >^^^^^^^^
79+
2 > ^^^^
80+
3 > ^
81+
4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^
82+
1 >
83+
2 > var
84+
3 > v
85+
4 >
86+
1 >Emitted(6, 9) Source(1, 6) + SourceIndex(0)
87+
2 >Emitted(6, 13) Source(1, 10) + SourceIndex(0)
88+
3 >Emitted(6, 14) Source(1, 11) + SourceIndex(0)
89+
4 >Emitted(6, 40) Source(1, 11) + SourceIndex(0)
90+
---
91+
>>> console.log(v);
92+
1 >^^^^^^^^
93+
2 > ^^^^^^^
94+
3 > ^
95+
4 > ^^^
96+
5 > ^
97+
6 > ^
98+
7 > ^
99+
8 > ^
100+
1 > of ['a', 'b', 'c']) {
101+
>
102+
2 > console
103+
3 > .
104+
4 > log
105+
5 > (
106+
6 > v
107+
7 > )
108+
8 > ;
109+
1 >Emitted(7, 9) Source(2, 5) + SourceIndex(0)
110+
2 >Emitted(7, 16) Source(2, 12) + SourceIndex(0)
111+
3 >Emitted(7, 17) Source(2, 13) + SourceIndex(0)
112+
4 >Emitted(7, 20) Source(2, 16) + SourceIndex(0)
113+
5 >Emitted(7, 21) Source(2, 17) + SourceIndex(0)
114+
6 >Emitted(7, 22) Source(2, 18) + SourceIndex(0)
115+
7 >Emitted(7, 23) Source(2, 19) + SourceIndex(0)
116+
8 >Emitted(7, 24) Source(2, 20) + SourceIndex(0)
117+
---
118+
>>> }
119+
1 >^^^^^
120+
1 >
121+
>}
122+
1 >Emitted(8, 6) Source(3, 2) + SourceIndex(0)
123+
---
124+
>>>}
125+
>>>catch (e_1_1) { e_1 = { error: e_1_1 }; }
126+
>>>finally {
127+
>>> try { __close(iterator_1); } finally { if (e_1) throw e_1.error; }
128+
>>>}
129+
>>>var e_1;
130+
>>>//# sourceMappingURL=ES5For-of33.js.map
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
tests/cases/conformance/statements/for-ofStatements/ES5For-of34.ts(4,6): error TS2322: Type 'string' is not assignable to type 'number'.
2+
3+
4+
==== tests/cases/conformance/statements/for-ofStatements/ES5For-of34.ts (1 errors) ====
5+
function foo() {
6+
return { x: 0 };
7+
}
8+
for (foo().x of ['a', 'b', 'c']) {
9+
~~~~~~~
10+
!!! error TS2322: Type 'string' is not assignable to type 'number'.
11+
var p = foo().x;
12+
}

tests/baselines/reference/ES5For-of34.js

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/baselines/reference/ES5For-of34.js.map

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)