Updated baselines

This commit is contained in:
Ron Buckton
2016-11-09 14:41:11 -08:00
parent bd867785bc
commit 549ac8f7ae
349 changed files with 34861 additions and 28409 deletions

View File

@@ -43,6 +43,17 @@ export function createProgram(rootFiles: string[], compilerOptionsJson: string):
* Please log a "breaking change" issue for any API breaking change affecting this issue
*/
"use strict";
var __values = (this && this.__values) || function (o) {
var i = o.__iterator__ || 0, d;
return i ? i.call(o) : { next: function () { return { done: d = d || i >= o.length, value: d ? void 0 : o[i++] }; } };
};
var __step = (this && this.__step) || function (r) {
return !(r.done || (r.done = (r.result = r.iterator.next()).done));
};
var __close = (this && this.__close) || function (r) {
var m = !(r && r.done) && r.iterator["return"];
if (m) return m.call(r.iterator);
};
var ts = require("typescript");
function printError(error) {
if (!error) {
@@ -59,12 +70,19 @@ function createProgram(rootFiles, compilerOptionsJson) {
var basePath = process.cwd();
var settings = ts.convertCompilerOptionsFromJson(config.config["compilerOptions"], basePath);
if (!settings.options) {
for (var _i = 0, _b = settings.errors; _i < _b.length; _i++) {
var err = _b[_i];
printError(err);
try {
for (var iterator_1 = { iterator: __values(settings.errors) }; __step(iterator_1);) {
var err = iterator_1.result.value;
printError(err);
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try { __close(iterator_1); } finally { if (e_1) throw e_1.error; }
}
return undefined;
}
return ts.createProgram(rootFiles, settings.options);
var e_1;
}
exports.createProgram = createProgram;

View File

@@ -2,6 +2,24 @@
for (var v of "") { }
//// [ES3For-ofTypeCheck1.js]
for (var _i = 0, _a = ""; _i < _a.length; _i++) {
var v = _a[_i];
var __values = (this && this.__values) || function (o) {
var i = o.__iterator__ || 0, d;
return i ? i.call(o) : { next: function () { return { done: d = d || i >= o.length, value: d ? void 0 : o[i++] }; } };
};
var __step = (this && this.__step) || function (r) {
return !(r.done || (r.done = (r.result = r.iterator.next()).done));
};
var __close = (this && this.__close) || function (r) {
var m = !(r && r.done) && r.iterator["return"];
if (m) return m.call(r.iterator);
};
try {
for (var iterator_1 = { iterator: __values("") }; __step(iterator_1);) {
var v = iterator_1.result.value;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try { __close(iterator_1); } finally { if (e_1) throw e_1.error; }
}
var e_1;

View File

@@ -3,7 +3,25 @@ var union: string | string[];
for (const v of union) { }
//// [ES3For-ofTypeCheck4.js]
var __values = (this && this.__values) || function (o) {
var i = o.__iterator__ || 0, d;
return i ? i.call(o) : { next: function () { return { done: d = d || i >= o.length, value: d ? void 0 : o[i++] }; } };
};
var __step = (this && this.__step) || function (r) {
return !(r.done || (r.done = (r.result = r.iterator.next()).done));
};
var __close = (this && this.__close) || function (r) {
var m = !(r && r.done) && r.iterator["return"];
if (m) return m.call(r.iterator);
};
var union;
for (var _i = 0, union_1 = union; _i < union_1.length; _i++) {
var v = union_1[_i];
try {
for (var union_1 = { iterator: __values(union) }; __step(union_1);) {
var v = union_1.result.value;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try { __close(union_1); } finally { if (e_1) throw e_1.error; }
}
var e_1;

View File

@@ -3,7 +3,25 @@ var union: string[] | number[];
for (var v of union) { }
//// [ES3For-ofTypeCheck6.js]
var __values = (this && this.__values) || function (o) {
var i = o.__iterator__ || 0, d;
return i ? i.call(o) : { next: function () { return { done: d = d || i >= o.length, value: d ? void 0 : o[i++] }; } };
};
var __step = (this && this.__step) || function (r) {
return !(r.done || (r.done = (r.result = r.iterator.next()).done));
};
var __close = (this && this.__close) || function (r) {
var m = !(r && r.done) && r.iterator["return"];
if (m) return m.call(r.iterator);
};
var union;
for (var _i = 0, union_1 = union; _i < union_1.length; _i++) {
var v = union_1[_i];
try {
for (var union_1 = { iterator: __values(union) }; __step(union_1);) {
var v = union_1.result.value;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try { __close(union_1); } finally { if (e_1) throw e_1.error; }
}
var e_1;

View File

@@ -2,6 +2,15 @@
for ([""] of [[""]]) { }
//// [ES5For-of12.js]
var __read = (this && this.__read) || function (o, n) {
if (!(m = o.__iterator__)) return o;
var m, i = m.call(o), ar = [], r, e;
try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); }
catch (error) { e = { error: error }; }
finally { try { if (m = !(r && r.done) && i["return"]) m.call(i); } finally { if (e) throw e.error; } }
return ar;
};
for (var _i = 0, _a = [[""]]; _i < _a.length; _i++) {
"" = _a[_i][0];
_b = __read(_a[_i], 1), "" = _b[0];
}
var _b;

View File

@@ -5,8 +5,26 @@ for (var v of a) {
}
//// [ES5For-of24.js]
var __values = (this && this.__values) || function (o) {
var i = o.__iterator__ || 0, d;
return i ? i.call(o) : { next: function () { return { done: d = d || i >= o.length, value: d ? void 0 : o[i++] }; } };
};
var __step = (this && this.__step) || function (r) {
return !(r.done || (r.done = (r.result = r.iterator.next()).done));
};
var __close = (this && this.__close) || function (r) {
var m = !(r && r.done) && r.iterator["return"];
if (m) return m.call(r.iterator);
};
var a = [1, 2, 3];
for (var _i = 0, a_1 = a; _i < a_1.length; _i++) {
var v = a_1[_i];
var a_2 = 0;
try {
for (var a_1 = { iterator: __values(a) }; __step(a_1);) {
var v = a_1.result.value;
var a_2 = 0;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try { __close(a_1); } finally { if (e_1) throw e_1.error; }
}
var e_1;

View File

@@ -6,10 +6,28 @@ for (var v of a) {
}
//// [ES5For-of25.js]
var __values = (this && this.__values) || function (o) {
var i = o.__iterator__ || 0, d;
return i ? i.call(o) : { next: function () { return { done: d = d || i >= o.length, value: d ? void 0 : o[i++] }; } };
};
var __step = (this && this.__step) || function (r) {
return !(r.done || (r.done = (r.result = r.iterator.next()).done));
};
var __close = (this && this.__close) || function (r) {
var m = !(r && r.done) && r.iterator["return"];
if (m) return m.call(r.iterator);
};
var a = [1, 2, 3];
for (var _i = 0, a_1 = a; _i < a_1.length; _i++) {
var v = a_1[_i];
v;
a;
try {
for (var a_1 = { iterator: __values(a) }; __step(a_1);) {
var v = a_1.result.value;
v;
a;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try { __close(a_1); } finally { if (e_1) throw e_1.error; }
}
var e_1;
//# sourceMappingURL=ES5For-of25.js.map

View File

@@ -1,2 +1,2 @@
//// [ES5For-of25.js.map]
{"version":3,"file":"ES5For-of25.js","sourceRoot":"","sources":["ES5For-of25.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAClB,GAAG,CAAC,CAAU,UAAC,EAAD,OAAC,EAAD,eAAC,EAAD,IAAC;IAAV,IAAI,CAAC,UAAA;IACN,CAAC,CAAC;IACF,CAAC,CAAC;CACL"}
{"version":3,"file":"ES5For-of25.js","sourceRoot":"","sources":["ES5For-of25.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;;IAClB,GAAG,CAAC,CAAU,IAAA,MAAA,EAAA,UAAA,SAAA,CAAC,CAAA,EAAA,EAAV,WAAK;QAAL,IAAI,CAAC,mBAAA;QACN,CAAC,CAAC;QACF,CAAC,CAAC;KACL"}

View File

@@ -8,6 +8,17 @@ sources: ES5For-of25.ts
emittedFile:tests/cases/conformance/statements/for-ofStatements/ES5For-of25.js
sourceFile:ES5For-of25.ts
-------------------------------------------------------------------
>>>var __values = (this && this.__values) || function (o) {
>>> var i = o.__iterator__ || 0, d;
>>> return i ? i.call(o) : { next: function () { return { done: d = d || i >= o.length, value: d ? void 0 : o[i++] }; } };
>>>};
>>>var __step = (this && this.__step) || function (r) {
>>> return !(r.done || (r.done = (r.result = r.iterator.next()).done));
>>>};
>>>var __close = (this && this.__close) || function (r) {
>>> var m = !(r && r.done) && r.iterator["return"];
>>> if (m) return m.call(r.iterator);
>>>};
>>>var a = [1, 2, 3];
1 >
2 >^^^^
@@ -21,7 +32,6 @@ sourceFile:ES5For-of25.ts
10> ^
11> ^
12> ^
13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
2 >var
3 > a
@@ -34,99 +44,114 @@ sourceFile:ES5For-of25.ts
10> 3
11> ]
12> ;
1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0)
3 >Emitted(1, 6) Source(1, 6) + SourceIndex(0)
4 >Emitted(1, 9) Source(1, 9) + SourceIndex(0)
5 >Emitted(1, 10) Source(1, 10) + SourceIndex(0)
6 >Emitted(1, 11) Source(1, 11) + SourceIndex(0)
7 >Emitted(1, 13) Source(1, 13) + SourceIndex(0)
8 >Emitted(1, 14) Source(1, 14) + SourceIndex(0)
9 >Emitted(1, 16) Source(1, 16) + SourceIndex(0)
10>Emitted(1, 17) Source(1, 17) + SourceIndex(0)
11>Emitted(1, 18) Source(1, 18) + SourceIndex(0)
12>Emitted(1, 19) Source(1, 19) + SourceIndex(0)
1 >Emitted(12, 1) Source(1, 1) + SourceIndex(0)
2 >Emitted(12, 5) Source(1, 5) + SourceIndex(0)
3 >Emitted(12, 6) Source(1, 6) + SourceIndex(0)
4 >Emitted(12, 9) Source(1, 9) + SourceIndex(0)
5 >Emitted(12, 10) Source(1, 10) + SourceIndex(0)
6 >Emitted(12, 11) Source(1, 11) + SourceIndex(0)
7 >Emitted(12, 13) Source(1, 13) + SourceIndex(0)
8 >Emitted(12, 14) Source(1, 14) + SourceIndex(0)
9 >Emitted(12, 16) Source(1, 16) + SourceIndex(0)
10>Emitted(12, 17) Source(1, 17) + SourceIndex(0)
11>Emitted(12, 18) Source(1, 18) + SourceIndex(0)
12>Emitted(12, 19) Source(1, 19) + SourceIndex(0)
---
>>>for (var _i = 0, a_1 = a; _i < a_1.length; _i++) {
1->
2 >^^^
3 > ^
4 > ^
5 > ^^^^^^^^^^
6 > ^^
7 > ^^^^^^^
8 > ^^
9 > ^^^^^^^^^^^^^^^
10> ^^
11> ^^^^
1->
>>>try {
>>> for (var a_1 = { iterator: __values(a) }; __step(a_1);) {
1 >^^^^
2 > ^^^
3 > ^
4 > ^
5 > ^^^^
6 > ^^^^^^
7 > ^^
8 > ^^^^^^^^^^
9 > ^^^^^^^^^
10> ^
11> ^
12> ^^
13> ^^
14> ^^^^^^^^^^^
1 >
>
2 >for
3 >
4 > (var v of
5 > a
6 >
7 > a
8 >
9 > a
10>
11> a
1->Emitted(2, 1) Source(2, 1) + SourceIndex(0)
2 >Emitted(2, 4) Source(2, 4) + SourceIndex(0)
3 >Emitted(2, 5) Source(2, 5) + SourceIndex(0)
4 >Emitted(2, 6) Source(2, 15) + SourceIndex(0)
5 >Emitted(2, 16) Source(2, 16) + SourceIndex(0)
6 >Emitted(2, 18) Source(2, 15) + SourceIndex(0)
7 >Emitted(2, 25) Source(2, 16) + SourceIndex(0)
8 >Emitted(2, 27) Source(2, 15) + SourceIndex(0)
9 >Emitted(2, 42) Source(2, 16) + SourceIndex(0)
10>Emitted(2, 44) Source(2, 15) + SourceIndex(0)
11>Emitted(2, 48) Source(2, 16) + SourceIndex(0)
2 > for
3 >
4 > (var v of
5 >
6 >
7 >
8 >
9 >
10> a
11>
12>
13>
14> var v
1 >Emitted(14, 5) Source(2, 1) + SourceIndex(0)
2 >Emitted(14, 8) Source(2, 4) + SourceIndex(0)
3 >Emitted(14, 9) Source(2, 5) + SourceIndex(0)
4 >Emitted(14, 10) Source(2, 15) + SourceIndex(0)
5 >Emitted(14, 14) Source(2, 15) + SourceIndex(0)
6 >Emitted(14, 20) Source(2, 15) + SourceIndex(0)
7 >Emitted(14, 22) Source(2, 15) + SourceIndex(0)
8 >Emitted(14, 32) Source(2, 15) + SourceIndex(0)
9 >Emitted(14, 41) Source(2, 15) + SourceIndex(0)
10>Emitted(14, 42) Source(2, 16) + SourceIndex(0)
11>Emitted(14, 43) Source(2, 16) + SourceIndex(0)
12>Emitted(14, 45) Source(2, 16) + SourceIndex(0)
13>Emitted(14, 47) Source(2, 6) + SourceIndex(0)
14>Emitted(14, 58) Source(2, 11) + SourceIndex(0)
---
>>> var v = a_1[_i];
1 >^^^^
2 > ^^^^
3 > ^
4 > ^^^^^^^^^^
>>> var v = a_1.result.value;
1 >^^^^^^^^
2 > ^^^^
3 > ^
4 > ^^^^^^^^^^^^^^^^^^^
1 >
2 > var
3 > v
4 >
1 >Emitted(3, 5) Source(2, 6) + SourceIndex(0)
2 >Emitted(3, 9) Source(2, 10) + SourceIndex(0)
3 >Emitted(3, 10) Source(2, 11) + SourceIndex(0)
4 >Emitted(3, 20) Source(2, 11) + SourceIndex(0)
2 > var
3 > v
4 >
1 >Emitted(15, 9) Source(2, 6) + SourceIndex(0)
2 >Emitted(15, 13) Source(2, 10) + SourceIndex(0)
3 >Emitted(15, 14) Source(2, 11) + SourceIndex(0)
4 >Emitted(15, 33) Source(2, 11) + SourceIndex(0)
---
>>> v;
1 >^^^^
2 > ^
3 > ^
4 > ^->
>>> v;
1 >^^^^^^^^
2 > ^
3 > ^
4 > ^->
1 > of a) {
>
2 > v
3 > ;
1 >Emitted(4, 5) Source(3, 5) + SourceIndex(0)
2 >Emitted(4, 6) Source(3, 6) + SourceIndex(0)
3 >Emitted(4, 7) Source(3, 7) + SourceIndex(0)
2 > v
3 > ;
1 >Emitted(16, 9) Source(3, 5) + SourceIndex(0)
2 >Emitted(16, 10) Source(3, 6) + SourceIndex(0)
3 >Emitted(16, 11) Source(3, 7) + SourceIndex(0)
---
>>> a;
1->^^^^
2 > ^
3 > ^
>>> a;
1->^^^^^^^^
2 > ^
3 > ^
1->
>
2 > a
3 > ;
1->Emitted(5, 5) Source(4, 5) + SourceIndex(0)
2 >Emitted(5, 6) Source(4, 6) + SourceIndex(0)
3 >Emitted(5, 7) Source(4, 7) + SourceIndex(0)
2 > a
3 > ;
1->Emitted(17, 9) Source(4, 5) + SourceIndex(0)
2 >Emitted(17, 10) Source(4, 6) + SourceIndex(0)
3 >Emitted(17, 11) Source(4, 7) + SourceIndex(0)
---
>>>}
1 >^
2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
>>> }
1 >^^^^^
1 >
>}
1 >Emitted(6, 2) Source(5, 2) + SourceIndex(0)
1 >Emitted(18, 6) Source(5, 2) + SourceIndex(0)
---
>>>}
>>>catch (e_1_1) { e_1 = { error: e_1_1 }; }
>>>finally {
>>> try { __close(a_1); } finally { if (e_1) throw e_1.error; }
>>>}
>>>var e_1;
>>>//# sourceMappingURL=ES5For-of25.js.map

View File

@@ -1,10 +1,10 @@
tests/cases/conformance/statements/for-ofStatements/ES5For-of26.ts(1,10): error TS2461: Type 'number' is not an array type.
tests/cases/conformance/statements/for-ofStatements/ES5For-of26.ts(1,10): error TS2461: Type 'number' is not an array type or does not have an '__iterator__()' method that returns an iterator.
==== tests/cases/conformance/statements/for-ofStatements/ES5For-of26.ts (1 errors) ====
for (var [a = 0, b = 1] of [2, 3]) {
~~~~~~~~~~~~~~
!!! error TS2461: Type 'number' is not an array type.
!!! error TS2461: Type 'number' is not an array type or does not have an '__iterator__()' method that returns an iterator.
a;
b;
}

View File

@@ -5,8 +5,16 @@ for (var [a = 0, b = 1] of [2, 3]) {
}
//// [ES5For-of26.js]
var __read = (this && this.__read) || function (o, n) {
if (!(m = o.__iterator__)) return o;
var m, i = m.call(o), ar = [], r, e;
try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); }
catch (error) { e = { error: error }; }
finally { try { if (m = !(r && r.done) && i["return"]) m.call(i); } finally { if (e) throw e.error; } }
return ar;
};
for (var _i = 0, _a = [2, 3]; _i < _a.length; _i++) {
var _b = _a[_i], _c = _b[0], a = _c === void 0 ? 0 : _c, _d = _b[1], b = _d === void 0 ? 1 : _d;
var _b = __read(_a[_i], 2), _c = _b[0], a = _c === void 0 ? 0 : _c, _d = _b[1], b = _d === void 0 ? 1 : _d;
a;
b;
}

View File

@@ -1,2 +1,2 @@
//// [ES5For-of26.js.map]
{"version":3,"file":"ES5For-of26.js","sourceRoot":"","sources":["ES5For-of26.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAuB,UAAM,EAAN,MAAC,CAAC,EAAE,CAAC,CAAC,EAAN,cAAM,EAAN,IAAM;IAAxB,IAAA,WAAc,EAAb,UAAK,EAAL,0BAAK,EAAE,UAAK,EAAL,0BAAK;IAClB,CAAC,CAAC;IACF,CAAC,CAAC;CACL"}
{"version":3,"file":"ES5For-of26.js","sourceRoot":"","sources":["ES5For-of26.ts"],"names":[],"mappings":";;;;;;;;AAAA,GAAG,CAAC,CAAuB,UAAM,EAAN,MAAC,CAAC,EAAE,CAAC,CAAC,EAAN,cAAM,EAAN,IAAM;IAAxB,IAAA,sBAAc,EAAb,UAAK,EAAL,0BAAK,EAAE,UAAK,EAAL,0BAAK;IAClB,CAAC,CAAC;IACF,CAAC,CAAC;CACL"}

View File

@@ -8,6 +8,14 @@ sources: ES5For-of26.ts
emittedFile:tests/cases/conformance/statements/for-ofStatements/ES5For-of26.js
sourceFile:ES5For-of26.ts
-------------------------------------------------------------------
>>>var __read = (this && this.__read) || function (o, n) {
>>> if (!(m = o.__iterator__)) return o;
>>> var m, i = m.call(o), ar = [], r, e;
>>> try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); }
>>> catch (error) { e = { error: error }; }
>>> finally { try { if (m = !(r && r.done) && i["return"]) m.call(i); } finally { if (e) throw e.error; } }
>>> return ar;
>>>};
>>>for (var _i = 0, _a = [2, 3]; _i < _a.length; _i++) {
1 >
2 >^^^
@@ -24,7 +32,7 @@ sourceFile:ES5For-of26.ts
13> ^^^^^^^^^^^^^^
14> ^^
15> ^^^^
16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
2 >for
3 >
@@ -40,56 +48,56 @@ sourceFile:ES5For-of26.ts
13> [2, 3]
14>
15> [2, 3]
1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
2 >Emitted(1, 4) Source(1, 4) + SourceIndex(0)
3 >Emitted(1, 5) Source(1, 5) + SourceIndex(0)
4 >Emitted(1, 6) Source(1, 28) + SourceIndex(0)
5 >Emitted(1, 16) Source(1, 34) + SourceIndex(0)
6 >Emitted(1, 18) Source(1, 28) + SourceIndex(0)
7 >Emitted(1, 24) Source(1, 29) + SourceIndex(0)
8 >Emitted(1, 25) Source(1, 30) + SourceIndex(0)
9 >Emitted(1, 27) Source(1, 32) + SourceIndex(0)
10>Emitted(1, 28) Source(1, 33) + SourceIndex(0)
11>Emitted(1, 29) Source(1, 34) + SourceIndex(0)
12>Emitted(1, 31) Source(1, 28) + SourceIndex(0)
13>Emitted(1, 45) Source(1, 34) + SourceIndex(0)
14>Emitted(1, 47) Source(1, 28) + SourceIndex(0)
15>Emitted(1, 51) Source(1, 34) + SourceIndex(0)
1 >Emitted(9, 1) Source(1, 1) + SourceIndex(0)
2 >Emitted(9, 4) Source(1, 4) + SourceIndex(0)
3 >Emitted(9, 5) Source(1, 5) + SourceIndex(0)
4 >Emitted(9, 6) Source(1, 28) + SourceIndex(0)
5 >Emitted(9, 16) Source(1, 34) + SourceIndex(0)
6 >Emitted(9, 18) Source(1, 28) + SourceIndex(0)
7 >Emitted(9, 24) Source(1, 29) + SourceIndex(0)
8 >Emitted(9, 25) Source(1, 30) + SourceIndex(0)
9 >Emitted(9, 27) Source(1, 32) + SourceIndex(0)
10>Emitted(9, 28) Source(1, 33) + SourceIndex(0)
11>Emitted(9, 29) Source(1, 34) + SourceIndex(0)
12>Emitted(9, 31) Source(1, 28) + SourceIndex(0)
13>Emitted(9, 45) Source(1, 34) + SourceIndex(0)
14>Emitted(9, 47) Source(1, 28) + SourceIndex(0)
15>Emitted(9, 51) Source(1, 34) + SourceIndex(0)
---
>>> var _b = _a[_i], _c = _b[0], a = _c === void 0 ? 0 : _c, _d = _b[1], b = _d === void 0 ? 1 : _d;
>>> var _b = __read(_a[_i], 2), _c = _b[0], a = _c === void 0 ? 0 : _c, _d = _b[1], b = _d === void 0 ? 1 : _d;
1->^^^^
2 > ^^^^
3 > ^^^^^^^^^^^
4 > ^^
5 > ^^^^^^^^^^
6 > ^^
7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^
8 > ^^
9 > ^^^^^^^^^^
10> ^^
11> ^^^^^^^^^^^^^^^^^^^^^^^^^^
3 > ^^^^^^^^^^^^^^^^^^^^^^
4 > ^^
5 > ^^^^^^^^^^
6 > ^^
7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^
8 > ^^
9 > ^^^^^^^^^^
10> ^^
11> ^^^^^^^^^^^^^^^^^^^^^^^^^^
1->
2 >
3 > [a = 0, b = 1]
4 >
5 > a = 0
6 >
7 > a = 0
8 > ,
9 > b = 1
10>
11> b = 1
1->Emitted(2, 5) Source(1, 10) + SourceIndex(0)
2 >Emitted(2, 9) Source(1, 10) + SourceIndex(0)
3 >Emitted(2, 20) Source(1, 24) + SourceIndex(0)
4 >Emitted(2, 22) Source(1, 11) + SourceIndex(0)
5 >Emitted(2, 32) Source(1, 16) + SourceIndex(0)
6 >Emitted(2, 34) Source(1, 11) + SourceIndex(0)
7 >Emitted(2, 60) Source(1, 16) + SourceIndex(0)
8 >Emitted(2, 62) Source(1, 18) + SourceIndex(0)
9 >Emitted(2, 72) Source(1, 23) + SourceIndex(0)
10>Emitted(2, 74) Source(1, 18) + SourceIndex(0)
11>Emitted(2, 100) Source(1, 23) + SourceIndex(0)
4 >
5 > a = 0
6 >
7 > a = 0
8 > ,
9 > b = 1
10>
11> b = 1
1->Emitted(10, 5) Source(1, 10) + SourceIndex(0)
2 >Emitted(10, 9) Source(1, 10) + SourceIndex(0)
3 >Emitted(10, 31) Source(1, 24) + SourceIndex(0)
4 >Emitted(10, 33) Source(1, 11) + SourceIndex(0)
5 >Emitted(10, 43) Source(1, 16) + SourceIndex(0)
6 >Emitted(10, 45) Source(1, 11) + SourceIndex(0)
7 >Emitted(10, 71) Source(1, 16) + SourceIndex(0)
8 >Emitted(10, 73) Source(1, 18) + SourceIndex(0)
9 >Emitted(10, 83) Source(1, 23) + SourceIndex(0)
10>Emitted(10, 85) Source(1, 18) + SourceIndex(0)
11>Emitted(10, 111) Source(1, 23) + SourceIndex(0)
---
>>> a;
1 >^^^^
@@ -100,9 +108,9 @@ sourceFile:ES5For-of26.ts
>
2 > a
3 > ;
1 >Emitted(3, 5) Source(2, 5) + SourceIndex(0)
2 >Emitted(3, 6) Source(2, 6) + SourceIndex(0)
3 >Emitted(3, 7) Source(2, 7) + SourceIndex(0)
1 >Emitted(11, 5) Source(2, 5) + SourceIndex(0)
2 >Emitted(11, 6) Source(2, 6) + SourceIndex(0)
3 >Emitted(11, 7) Source(2, 7) + SourceIndex(0)
---
>>> b;
1->^^^^
@@ -112,15 +120,15 @@ sourceFile:ES5For-of26.ts
>
2 > b
3 > ;
1->Emitted(4, 5) Source(3, 5) + SourceIndex(0)
2 >Emitted(4, 6) Source(3, 6) + SourceIndex(0)
3 >Emitted(4, 7) Source(3, 7) + SourceIndex(0)
1->Emitted(12, 5) Source(3, 5) + SourceIndex(0)
2 >Emitted(12, 6) Source(3, 6) + SourceIndex(0)
3 >Emitted(12, 7) Source(3, 7) + SourceIndex(0)
---
>>>}
1 >^
2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
>}
1 >Emitted(5, 2) Source(4, 2) + SourceIndex(0)
1 >Emitted(13, 2) Source(4, 2) + SourceIndex(0)
---
>>>//# sourceMappingURL=ES5For-of26.js.map

View File

@@ -1,10 +1,10 @@
tests/cases/conformance/statements/for-ofStatements/ES5For-of28.ts(1,10): error TS2461: Type 'number' is not an array type.
tests/cases/conformance/statements/for-ofStatements/ES5For-of28.ts(1,10): error TS2461: Type 'number' is not an array type or does not have an '__iterator__()' method that returns an iterator.
==== tests/cases/conformance/statements/for-ofStatements/ES5For-of28.ts (1 errors) ====
for (let [a = 0, b = 1] of [2, 3]) {
~~~~~~~~~~~~~~
!!! error TS2461: Type 'number' is not an array type.
!!! error TS2461: Type 'number' is not an array type or does not have an '__iterator__()' method that returns an iterator.
a;
b;
}

View File

@@ -5,8 +5,16 @@ for (let [a = 0, b = 1] of [2, 3]) {
}
//// [ES5For-of28.js]
var __read = (this && this.__read) || function (o, n) {
if (!(m = o.__iterator__)) return o;
var m, i = m.call(o), ar = [], r, e;
try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); }
catch (error) { e = { error: error }; }
finally { try { if (m = !(r && r.done) && i["return"]) m.call(i); } finally { if (e) throw e.error; } }
return ar;
};
for (var _i = 0, _a = [2, 3]; _i < _a.length; _i++) {
var _b = _a[_i], _c = _b[0], a = _c === void 0 ? 0 : _c, _d = _b[1], b = _d === void 0 ? 1 : _d;
var _b = __read(_a[_i], 2), _c = _b[0], a = _c === void 0 ? 0 : _c, _d = _b[1], b = _d === void 0 ? 1 : _d;
a;
b;
}

View File

@@ -1,4 +1,4 @@
tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,6): error TS2461: Type 'string | number' is not an array type.
tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,6): error TS2461: Type 'string | number' is not an array type or does not have an '__iterator__()' method that returns an iterator.
tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,7): error TS2322: Type '1' is not assignable to type 'string'.
tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,14): error TS2322: Type '""' is not assignable to type 'number'.
@@ -8,7 +8,7 @@ tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,14): error
var tuple: [number, string] = [2, "3"];
for ([a = 1, b = ""] of tuple) {
~~~~~~~~~~~~~~~
!!! error TS2461: Type 'string | number' is not an array type.
!!! error TS2461: Type 'string | number' is not an array type or does not have an '__iterator__()' method that returns an iterator.
~
!!! error TS2322: Type '1' is not assignable to type 'string'.
~

View File

@@ -7,11 +7,36 @@ for ([a = 1, b = ""] of tuple) {
}
//// [ES5For-of30.js]
var __read = (this && this.__read) || function (o, n) {
if (!(m = o.__iterator__)) return o;
var m, i = m.call(o), ar = [], r, e;
try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); }
catch (error) { e = { error: error }; }
finally { try { if (m = !(r && r.done) && i["return"]) m.call(i); } finally { if (e) throw e.error; } }
return ar;
};
var __values = (this && this.__values) || function (o) {
var i = o.__iterator__ || 0, d;
return i ? i.call(o) : { next: function () { return { done: d = d || i >= o.length, value: d ? void 0 : o[i++] }; } };
};
var __step = (this && this.__step) || function (r) {
return !(r.done || (r.done = (r.result = r.iterator.next()).done));
};
var __close = (this && this.__close) || function (r) {
var m = !(r && r.done) && r.iterator["return"];
if (m) return m.call(r.iterator);
};
var a, b;
var tuple = [2, "3"];
for (var _i = 0, tuple_1 = tuple; _i < tuple_1.length; _i++) {
_a = tuple_1[_i], _b = _a[0], a = _b === void 0 ? 1 : _b, _c = _a[1], b = _c === void 0 ? "" : _c;
a;
b;
try {
for (var tuple_1 = { iterator: __values(tuple) }; __step(tuple_1);) {
_a = __read(tuple_1.result.value, 2), _b = _a[0], a = _b === void 0 ? 1 : _b, _c = _a[1], b = _c === void 0 ? "" : _c;
a;
b;
}
}
var _a, _b, _c;
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try { __close(tuple_1); } finally { if (e_1) throw e_1.error; }
}
var _a, _b, _c, e_1;

View File

@@ -2,6 +2,24 @@
for (var v of "") { }
//// [ES5For-ofTypeCheck1.js]
for (var _i = 0, _a = ""; _i < _a.length; _i++) {
var v = _a[_i];
var __values = (this && this.__values) || function (o) {
var i = o.__iterator__ || 0, d;
return i ? i.call(o) : { next: function () { return { done: d = d || i >= o.length, value: d ? void 0 : o[i++] }; } };
};
var __step = (this && this.__step) || function (r) {
return !(r.done || (r.done = (r.result = r.iterator.next()).done));
};
var __close = (this && this.__close) || function (r) {
var m = !(r && r.done) && r.iterator["return"];
if (m) return m.call(r.iterator);
};
try {
for (var iterator_1 = { iterator: __values("") }; __step(iterator_1);) {
var v = iterator_1.result.value;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try { __close(iterator_1); } finally { if (e_1) throw e_1.error; }
}
var e_1;

View File

@@ -1,11 +1,11 @@
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck10.ts(1,15): error TS2495: Type 'StringIterator' is not an array type or a string type.
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck10.ts(1,15): error TS2495: Type 'StringIterator' is not an array type or a string type or does not have an '__iterator__()' method that returns an iterator.
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck10.ts(11,6): error TS2304: Cannot find name 'Symbol'.
==== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck10.ts (2 errors) ====
for (var v of new StringIterator) { }
~~~~~~~~~~~~~~~~~~
!!! error TS2495: Type 'StringIterator' is not an array type or a string type.
!!! error TS2495: Type 'StringIterator' is not an array type or a string type or does not have an '__iterator__()' method that returns an iterator.
// In ES3/5, you cannot for...of over an arbitrary iterable.
class StringIterator {

View File

@@ -15,8 +15,25 @@ class StringIterator {
}
//// [ES5For-ofTypeCheck10.js]
for (var _i = 0, _a = new StringIterator; _i < _a.length; _i++) {
var v = _a[_i];
var __values = (this && this.__values) || function (o) {
var i = o.__iterator__ || 0, d;
return i ? i.call(o) : { next: function () { return { done: d = d || i >= o.length, value: d ? void 0 : o[i++] }; } };
};
var __step = (this && this.__step) || function (r) {
return !(r.done || (r.done = (r.result = r.iterator.next()).done));
};
var __close = (this && this.__close) || function (r) {
var m = !(r && r.done) && r.iterator["return"];
if (m) return m.call(r.iterator);
};
try {
for (var iterator_1 = { iterator: __values(new StringIterator) }; __step(iterator_1);) {
var v = iterator_1.result.value;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try { __close(iterator_1); } finally { if (e_1) throw e_1.error; }
}
// In ES3/5, you cannot for...of over an arbitrary iterable.
var StringIterator = (function () {
@@ -33,3 +50,4 @@ var StringIterator = (function () {
};
return StringIterator;
}());
var e_1;

View File

@@ -4,8 +4,26 @@ var v: string;
for (v of union) { }
//// [ES5For-ofTypeCheck11.js]
var __values = (this && this.__values) || function (o) {
var i = o.__iterator__ || 0, d;
return i ? i.call(o) : { next: function () { return { done: d = d || i >= o.length, value: d ? void 0 : o[i++] }; } };
};
var __step = (this && this.__step) || function (r) {
return !(r.done || (r.done = (r.result = r.iterator.next()).done));
};
var __close = (this && this.__close) || function (r) {
var m = !(r && r.done) && r.iterator["return"];
if (m) return m.call(r.iterator);
};
var union;
var v;
for (var _i = 0, union_1 = union; _i < union_1.length; _i++) {
v = union_1[_i];
try {
for (var union_1 = { iterator: __values(union) }; __step(union_1);) {
v = union_1.result.value;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try { __close(union_1); } finally { if (e_1) throw e_1.error; }
}
var e_1;

View File

@@ -1,7 +1,7 @@
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck12.ts(1,17): error TS2495: Type '0' is not an array type or a string type.
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck12.ts(1,17): error TS2495: Type '0' is not an array type or a string type or does not have an '__iterator__()' method that returns an iterator.
==== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck12.ts (1 errors) ====
for (const v of 0) { }
~
!!! error TS2495: Type '0' is not an array type or a string type.
!!! error TS2495: Type '0' is not an array type or a string type or does not have an '__iterator__()' method that returns an iterator.

View File

@@ -2,6 +2,24 @@
for (const v of 0) { }
//// [ES5For-ofTypeCheck12.js]
for (var _i = 0, _a = 0; _i < _a.length; _i++) {
var v = _a[_i];
var __values = (this && this.__values) || function (o) {
var i = o.__iterator__ || 0, d;
return i ? i.call(o) : { next: function () { return { done: d = d || i >= o.length, value: d ? void 0 : o[i++] }; } };
};
var __step = (this && this.__step) || function (r) {
return !(r.done || (r.done = (r.result = r.iterator.next()).done));
};
var __close = (this && this.__close) || function (r) {
var m = !(r && r.done) && r.iterator["return"];
if (m) return m.call(r.iterator);
};
try {
for (var iterator_1 = { iterator: __values(0) }; __step(iterator_1);) {
var v = iterator_1.result.value;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try { __close(iterator_1); } finally { if (e_1) throw e_1.error; }
}
var e_1;

View File

@@ -3,7 +3,25 @@ var tuple: [string, number] = ["", 0];
for (var v of tuple) { }
//// [ES5For-ofTypeCheck3.js]
var __values = (this && this.__values) || function (o) {
var i = o.__iterator__ || 0, d;
return i ? i.call(o) : { next: function () { return { done: d = d || i >= o.length, value: d ? void 0 : o[i++] }; } };
};
var __step = (this && this.__step) || function (r) {
return !(r.done || (r.done = (r.result = r.iterator.next()).done));
};
var __close = (this && this.__close) || function (r) {
var m = !(r && r.done) && r.iterator["return"];
if (m) return m.call(r.iterator);
};
var tuple = ["", 0];
for (var _i = 0, tuple_1 = tuple; _i < tuple_1.length; _i++) {
var v = tuple_1[_i];
try {
for (var tuple_1 = { iterator: __values(tuple) }; __step(tuple_1);) {
var v = tuple_1.result.value;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try { __close(tuple_1); } finally { if (e_1) throw e_1.error; }
}
var e_1;

View File

@@ -3,7 +3,25 @@ var union: string | string[];
for (const v of union) { }
//// [ES5For-ofTypeCheck4.js]
var __values = (this && this.__values) || function (o) {
var i = o.__iterator__ || 0, d;
return i ? i.call(o) : { next: function () { return { done: d = d || i >= o.length, value: d ? void 0 : o[i++] }; } };
};
var __step = (this && this.__step) || function (r) {
return !(r.done || (r.done = (r.result = r.iterator.next()).done));
};
var __close = (this && this.__close) || function (r) {
var m = !(r && r.done) && r.iterator["return"];
if (m) return m.call(r.iterator);
};
var union;
for (var _i = 0, union_1 = union; _i < union_1.length; _i++) {
var v = union_1[_i];
try {
for (var union_1 = { iterator: __values(union) }; __step(union_1);) {
var v = union_1.result.value;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try { __close(union_1); } finally { if (e_1) throw e_1.error; }
}
var e_1;

View File

@@ -3,7 +3,25 @@ var union: string | number[];
for (var v of union) { }
//// [ES5For-ofTypeCheck5.js]
var __values = (this && this.__values) || function (o) {
var i = o.__iterator__ || 0, d;
return i ? i.call(o) : { next: function () { return { done: d = d || i >= o.length, value: d ? void 0 : o[i++] }; } };
};
var __step = (this && this.__step) || function (r) {
return !(r.done || (r.done = (r.result = r.iterator.next()).done));
};
var __close = (this && this.__close) || function (r) {
var m = !(r && r.done) && r.iterator["return"];
if (m) return m.call(r.iterator);
};
var union;
for (var _i = 0, union_1 = union; _i < union_1.length; _i++) {
var v = union_1[_i];
try {
for (var union_1 = { iterator: __values(union) }; __step(union_1);) {
var v = union_1.result.value;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try { __close(union_1); } finally { if (e_1) throw e_1.error; }
}
var e_1;

View File

@@ -3,7 +3,25 @@ var union: string[] | number[];
for (var v of union) { }
//// [ES5For-ofTypeCheck6.js]
var __values = (this && this.__values) || function (o) {
var i = o.__iterator__ || 0, d;
return i ? i.call(o) : { next: function () { return { done: d = d || i >= o.length, value: d ? void 0 : o[i++] }; } };
};
var __step = (this && this.__step) || function (r) {
return !(r.done || (r.done = (r.result = r.iterator.next()).done));
};
var __close = (this && this.__close) || function (r) {
var m = !(r && r.done) && r.iterator["return"];
if (m) return m.call(r.iterator);
};
var union;
for (var _i = 0, union_1 = union; _i < union_1.length; _i++) {
var v = union_1[_i];
try {
for (var union_1 = { iterator: __values(union) }; __step(union_1);) {
var v = union_1.result.value;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try { __close(union_1); } finally { if (e_1) throw e_1.error; }
}
var e_1;

View File

@@ -1,8 +1,8 @@
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck7.ts(2,15): error TS2461: Type 'number' is not an array type.
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck7.ts(2,15): error TS2461: Type 'number' is not an array type or does not have an '__iterator__()' method that returns an iterator.
==== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck7.ts (1 errors) ====
var union: string | number;
for (var v of union) { }
~~~~~
!!! error TS2461: Type 'number' is not an array type.
!!! error TS2461: Type 'number' is not an array type or does not have an '__iterator__()' method that returns an iterator.

View File

@@ -3,7 +3,25 @@ var union: string | number;
for (var v of union) { }
//// [ES5For-ofTypeCheck7.js]
var __values = (this && this.__values) || function (o) {
var i = o.__iterator__ || 0, d;
return i ? i.call(o) : { next: function () { return { done: d = d || i >= o.length, value: d ? void 0 : o[i++] }; } };
};
var __step = (this && this.__step) || function (r) {
return !(r.done || (r.done = (r.result = r.iterator.next()).done));
};
var __close = (this && this.__close) || function (r) {
var m = !(r && r.done) && r.iterator["return"];
if (m) return m.call(r.iterator);
};
var union;
for (var _i = 0, union_1 = union; _i < union_1.length; _i++) {
var v = union_1[_i];
try {
for (var union_1 = { iterator: __values(union) }; __step(union_1);) {
var v = union_1.result.value;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try { __close(union_1); } finally { if (e_1) throw e_1.error; }
}
var e_1;

View File

@@ -4,8 +4,26 @@ var v: symbol;
for (v of union) { }
//// [ES5For-ofTypeCheck8.js]
var __values = (this && this.__values) || function (o) {
var i = o.__iterator__ || 0, d;
return i ? i.call(o) : { next: function () { return { done: d = d || i >= o.length, value: d ? void 0 : o[i++] }; } };
};
var __step = (this && this.__step) || function (r) {
return !(r.done || (r.done = (r.result = r.iterator.next()).done));
};
var __close = (this && this.__close) || function (r) {
var m = !(r && r.done) && r.iterator["return"];
if (m) return m.call(r.iterator);
};
var union;
var v;
for (var _i = 0, union_1 = union; _i < union_1.length; _i++) {
v = union_1[_i];
try {
for (var union_1 = { iterator: __values(union) }; __step(union_1);) {
v = union_1.result.value;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try { __close(union_1); } finally { if (e_1) throw e_1.error; }
}
var e_1;

View File

@@ -1,8 +1,8 @@
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck9.ts(2,15): error TS2461: Type 'number | symbol | string[]' is not an array type.
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck9.ts(2,15): error TS2461: Type 'number | symbol | string[]' is not an array type or does not have an '__iterator__()' method that returns an iterator.
==== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck9.ts (1 errors) ====
var union: string | string[] | number | symbol;
for (let v of union) { }
~~~~~
!!! error TS2461: Type 'number | symbol | string[]' is not an array type.
!!! error TS2461: Type 'number | symbol | string[]' is not an array type or does not have an '__iterator__()' method that returns an iterator.

View File

@@ -3,7 +3,25 @@ var union: string | string[] | number | symbol;
for (let v of union) { }
//// [ES5For-ofTypeCheck9.js]
var __values = (this && this.__values) || function (o) {
var i = o.__iterator__ || 0, d;
return i ? i.call(o) : { next: function () { return { done: d = d || i >= o.length, value: d ? void 0 : o[i++] }; } };
};
var __step = (this && this.__step) || function (r) {
return !(r.done || (r.done = (r.result = r.iterator.next()).done));
};
var __close = (this && this.__close) || function (r) {
var m = !(r && r.done) && r.iterator["return"];
if (m) return m.call(r.iterator);
};
var union;
for (var _i = 0, union_1 = union; _i < union_1.length; _i++) {
var v = union_1[_i];
try {
for (var union_1 = { iterator: __values(union) }; __step(union_1);) {
var v = union_1.result.value;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try { __close(union_1); } finally { if (e_1) throw e_1.error; }
}
var e_1;

View File

@@ -12,12 +12,30 @@ for (let num of array) {
}
//// [ES5for-of32.js]
var __values = (this && this.__values) || function (o) {
var i = o.__iterator__ || 0, d;
return i ? i.call(o) : { next: function () { return { done: d = d || i >= o.length, value: d ? void 0 : o[i++] }; } };
};
var __step = (this && this.__step) || function (r) {
return !(r.done || (r.done = (r.result = r.iterator.next()).done));
};
var __close = (this && this.__close) || function (r) {
var m = !(r && r.done) && r.iterator["return"];
if (m) return m.call(r.iterator);
};
var array = [1, 2, 3];
var sum = 0;
for (var _i = 0, array_1 = array; _i < array_1.length; _i++) {
var num = array_1[_i];
if (sum === 0) {
array = [4, 5, 6];
try {
for (var array_1 = { iterator: __values(array) }; __step(array_1);) {
var num = array_1.result.value;
if (sum === 0) {
array = [4, 5, 6];
}
sum += num;
}
sum += num;
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try { __close(array_1); } finally { if (e_1) throw e_1.error; }
}
var e_1;

View File

@@ -3,8 +3,41 @@ function * foo(a = yield => yield) {
}
//// [FunctionDeclaration10_es6.js]
function* foo(a) {
if (a === void 0) { a = yield; }
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t;
return { next: verb(0), "throw": verb(1), "return": verb(2), __iterator__: function () { return this; } };
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
function foo(a) {
if (a === void 0) { a = _a.sent(); }
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/];
case 1: return [2 /*return*/];
}
});
}
yield;
{

View File

@@ -1,8 +0,0 @@
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration11_es6.ts(1,10): error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration11_es6.ts (1 errors) ====
function * yield() {
~
!!! error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
}

View File

@@ -3,5 +3,35 @@ function * yield() {
}
//// [FunctionDeclaration11_es6.js]
function* yield() {
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t;
return { next: verb(0), "throw": verb(1), "return": verb(2), __iterator__: function () { return this; } };
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
function yield() {
return __generator(this, function (_a) {
return [2 /*return*/];
});
}

View File

@@ -0,0 +1,4 @@
=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration11_es6.ts ===
function * yield() {
>yield : Symbol(yield, Decl(FunctionDeclaration11_es6.ts, 0, 0))
}

View File

@@ -0,0 +1,4 @@
=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration11_es6.ts ===
function * yield() {
>yield : () => PseudoIterableIterator<any>
}

View File

@@ -2,4 +2,33 @@
var v = function * yield() { }
//// [FunctionDeclaration12_es6.js]
var v = function* () { }, yield = function () { };
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t;
return { next: verb(0), "throw": verb(1), "return": verb(2), __iterator__: function () { return this; } };
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var v = function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); }, yield = function () { };

View File

@@ -1,11 +1,8 @@
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts(1,10): error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts(3,11): error TS2304: Cannot find name 'yield'.
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts (2 errors) ====
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts (1 errors) ====
function * foo() {
~
!!! error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
// Legal to use 'yield' in a type context.
var v: yield;
~~~~~

View File

@@ -6,7 +6,36 @@ function * foo() {
//// [FunctionDeclaration13_es6.js]
function* foo() {
// Legal to use 'yield' in a type context.
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t;
return { next: verb(0), "throw": verb(1), "return": verb(2), __iterator__: function () { return this; } };
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
function foo() {
var v;
return __generator(this, function (_a) {
return [2 /*return*/];
});
}

View File

@@ -1,8 +0,0 @@
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration1_es6.ts(1,10): error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration1_es6.ts (1 errors) ====
function * foo() {
~
!!! error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
}

View File

@@ -3,5 +3,35 @@ function * foo() {
}
//// [FunctionDeclaration1_es6.js]
function* foo() {
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t;
return { next: verb(0), "throw": verb(1), "return": verb(2), __iterator__: function () { return this; } };
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
function foo() {
return __generator(this, function (_a) {
return [2 /*return*/];
});
}

View File

@@ -0,0 +1,4 @@
=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration1_es6.ts ===
function * foo() {
>foo : Symbol(foo, Decl(FunctionDeclaration1_es6.ts, 0, 0))
}

View File

@@ -0,0 +1,4 @@
=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration1_es6.ts ===
function * foo() {
>foo : () => PseudoIterableIterator<any>
}

View File

@@ -3,7 +3,36 @@ function*foo(yield) {
}
//// [FunctionDeclaration5_es6.js]
function* foo() { }
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t;
return { next: verb(0), "throw": verb(1), "return": verb(2), __iterator__: function () { return this; } };
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
function foo() { return __generator(this, function (_a) {
return [2 /*return*/];
}); }
yield;
{
}

View File

@@ -1,11 +1,8 @@
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts(1,9): error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts(1,18): error TS2523: 'yield' expressions cannot be used in a parameter initializer.
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts (2 errors) ====
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts (1 errors) ====
function*foo(a = yield) {
~
!!! error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
~~~~~
!!! error TS2523: 'yield' expressions cannot be used in a parameter initializer.
}

View File

@@ -3,6 +3,39 @@ function*foo(a = yield) {
}
//// [FunctionDeclaration6_es6.js]
function* foo(a) {
if (a === void 0) { a = yield; }
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t;
return { next: verb(0), "throw": verb(1), "return": verb(2), __iterator__: function () { return this; } };
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
function foo(a) {
if (a === void 0) { a = _a.sent(); }
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/];
case 1: return [2 /*return*/];
}
});
}

View File

@@ -1,16 +1,10 @@
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts(1,9): error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts(3,11): error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts(3,20): error TS2523: 'yield' expressions cannot be used in a parameter initializer.
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts (3 errors) ====
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts (1 errors) ====
function*bar() {
~
!!! error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
// 'yield' here is an identifier, and not a yield expression.
function*foo(a = yield) {
~
!!! error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
~~~~~
!!! error TS2523: 'yield' expressions cannot be used in a parameter initializer.
}

View File

@@ -6,9 +6,45 @@ function*bar() {
}
//// [FunctionDeclaration7_es6.js]
function* bar() {
// 'yield' here is an identifier, and not a yield expression.
function* foo(a) {
if (a === void 0) { a = yield; }
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t;
return { next: verb(0), "throw": verb(1), "return": verb(2), __iterator__: function () { return this; } };
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
function bar() {
// 'yield' here is an identifier, and not a yield expression.
function foo(a) {
if (a === void 0) { a = _a.sent(); }
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/];
case 1: return [2 /*return*/];
}
});
}
return __generator(this, function (_a) {
return [2 /*return*/];
});
}

View File

@@ -1,9 +0,0 @@
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts(1,10): error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts (1 errors) ====
function * foo() {
~
!!! error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
var v = { [yield]: foo }
}

View File

@@ -4,7 +4,43 @@ function * foo() {
}
//// [FunctionDeclaration9_es6.js]
function* foo() {
var v = (_a = {}, _a[yield] = foo, _a);
var _a;
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t;
return { next: verb(0), "throw": verb(1), "return": verb(2), __iterator__: function () { return this; } };
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
function foo() {
var v, _a;
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = {};
return [4 /*yield*/];
case 1:
v = (_a[_b.sent()] = foo, _a);
return [2 /*return*/];
}
});
}

View File

@@ -0,0 +1,8 @@
=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts ===
function * foo() {
>foo : Symbol(foo, Decl(FunctionDeclaration9_es6.ts, 0, 0))
var v = { [yield]: foo }
>v : Symbol(v, Decl(FunctionDeclaration9_es6.ts, 1, 5))
>foo : Symbol(foo, Decl(FunctionDeclaration9_es6.ts, 0, 0))
}

View File

@@ -0,0 +1,10 @@
=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts ===
function * foo() {
>foo : () => PseudoIterableIterator<any>
var v = { [yield]: foo }
>v : { [x: number]: () => PseudoIterableIterator<any>; }
>{ [yield]: foo } : { [x: number]: () => PseudoIterableIterator<any>; }
>yield : any
>foo : () => PseudoIterableIterator<any>
}

View File

@@ -1,7 +0,0 @@
tests/cases/conformance/es6/functionExpressions/FunctionExpression1_es6.ts(1,18): error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
==== tests/cases/conformance/es6/functionExpressions/FunctionExpression1_es6.ts (1 errors) ====
var v = function * () { }
~
!!! error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.

View File

@@ -2,4 +2,33 @@
var v = function * () { }
//// [FunctionExpression1_es6.js]
var v = function* () { };
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t;
return { next: verb(0), "throw": verb(1), "return": verb(2), __iterator__: function () { return this; } };
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var v = function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); };

View File

@@ -0,0 +1,4 @@
=== tests/cases/conformance/es6/functionExpressions/FunctionExpression1_es6.ts ===
var v = function * () { }
>v : Symbol(v, Decl(FunctionExpression1_es6.ts, 0, 3))

View File

@@ -0,0 +1,5 @@
=== tests/cases/conformance/es6/functionExpressions/FunctionExpression1_es6.ts ===
var v = function * () { }
>v : () => PseudoIterableIterator<any>
>function * () { } : () => PseudoIterableIterator<any>

View File

@@ -1,7 +0,0 @@
tests/cases/conformance/es6/functionExpressions/FunctionExpression2_es6.ts(1,18): error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
==== tests/cases/conformance/es6/functionExpressions/FunctionExpression2_es6.ts (1 errors) ====
var v = function * foo() { }
~
!!! error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.

View File

@@ -2,4 +2,33 @@
var v = function * foo() { }
//// [FunctionExpression2_es6.js]
var v = function* foo() { };
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t;
return { next: verb(0), "throw": verb(1), "return": verb(2), __iterator__: function () { return this; } };
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var v = function foo() { return __generator(this, function (_a) {
return [2 /*return*/];
}); };

View File

@@ -0,0 +1,5 @@
=== tests/cases/conformance/es6/functionExpressions/FunctionExpression2_es6.ts ===
var v = function * foo() { }
>v : Symbol(v, Decl(FunctionExpression2_es6.ts, 0, 3))
>foo : Symbol(foo, Decl(FunctionExpression2_es6.ts, 0, 7))

View File

@@ -0,0 +1,6 @@
=== tests/cases/conformance/es6/functionExpressions/FunctionExpression2_es6.ts ===
var v = function * foo() { }
>v : () => PseudoIterableIterator<any>
>function * foo() { } : () => PseudoIterableIterator<any>
>foo : () => PseudoIterableIterator<any>

View File

@@ -1,7 +0,0 @@
tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments1_es6.ts(1,11): error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
==== tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments1_es6.ts (1 errors) ====
var v = { *foo() { } }
~
!!! error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.

View File

@@ -2,4 +2,33 @@
var v = { *foo() { } }
//// [FunctionPropertyAssignments1_es6.js]
var v = { foo: function* () { } };
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t;
return { next: verb(0), "throw": verb(1), "return": verb(2), __iterator__: function () { return this; } };
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var v = { foo: function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); } };

View File

@@ -0,0 +1,5 @@
=== tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments1_es6.ts ===
var v = { *foo() { } }
>v : Symbol(v, Decl(FunctionPropertyAssignments1_es6.ts, 0, 3))
>foo : Symbol(foo, Decl(FunctionPropertyAssignments1_es6.ts, 0, 9))

View File

@@ -0,0 +1,6 @@
=== tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments1_es6.ts ===
var v = { *foo() { } }
>v : { foo(): PseudoIterableIterator<any>; }
>{ *foo() { } } : { foo(): PseudoIterableIterator<any>; }
>foo : () => PseudoIterableIterator<any>

View File

@@ -2,4 +2,33 @@
var v = { *() { } }
//// [FunctionPropertyAssignments2_es6.js]
var v = { : function* () { } };
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t;
return { next: verb(0), "throw": verb(1), "return": verb(2), __iterator__: function () { return this; } };
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var v = { : function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); } };

View File

@@ -2,4 +2,33 @@
var v = { *{ } }
//// [FunctionPropertyAssignments3_es6.js]
var v = { : function* () { } };
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t;
return { next: verb(0), "throw": verb(1), "return": verb(2), __iterator__: function () { return this; } };
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var v = { : function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); } };

View File

@@ -1,10 +1,7 @@
tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts(1,11): error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts(1,13): error TS2304: Cannot find name 'foo'.
==== tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts (2 errors) ====
==== tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts (1 errors) ====
var v = { *[foo()]() { } }
~
!!! error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
~~~
!!! error TS2304: Cannot find name 'foo'.

View File

@@ -2,5 +2,34 @@
var v = { *[foo()]() { } }
//// [FunctionPropertyAssignments5_es6.js]
var v = (_a = {}, _a[foo()] = function* () { }, _a);
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t;
return { next: verb(0), "throw": verb(1), "return": verb(2), __iterator__: function () { return this; } };
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var v = (_a = {}, _a[foo()] = function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); }, _a);
var _a;

View File

@@ -2,4 +2,33 @@
var v = { *<T>() { } }
//// [FunctionPropertyAssignments6_es6.js]
var v = { : function* () { } };
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t;
return { next: verb(0), "throw": verb(1), "return": verb(2), __iterator__: function () { return this; } };
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var v = { : function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); } };

View File

@@ -1,9 +0,0 @@
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration1_es6.ts(2,4): error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration1_es6.ts (1 errors) ====
class C {
*foo() { }
~
!!! error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
}

View File

@@ -4,9 +4,38 @@ class C {
}
//// [MemberFunctionDeclaration1_es6.js]
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t;
return { next: verb(0), "throw": verb(1), "return": verb(2), __iterator__: function () { return this; } };
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var C = (function () {
function C() {
}
C.prototype.foo = function* () { };
C.prototype.foo = function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); };
return C;
}());

View File

@@ -0,0 +1,7 @@
=== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration1_es6.ts ===
class C {
>C : Symbol(C, Decl(MemberFunctionDeclaration1_es6.ts, 0, 0))
*foo() { }
>foo : Symbol(C.foo, Decl(MemberFunctionDeclaration1_es6.ts, 0, 9))
}

View File

@@ -0,0 +1,7 @@
=== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration1_es6.ts ===
class C {
>C : C
*foo() { }
>foo : () => PseudoIterableIterator<any>
}

View File

@@ -1,9 +0,0 @@
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration2_es6.ts(2,11): error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration2_es6.ts (1 errors) ====
class C {
public * foo() { }
~
!!! error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
}

View File

@@ -4,9 +4,38 @@ class C {
}
//// [MemberFunctionDeclaration2_es6.js]
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t;
return { next: verb(0), "throw": verb(1), "return": verb(2), __iterator__: function () { return this; } };
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var C = (function () {
function C() {
}
C.prototype.foo = function* () { };
C.prototype.foo = function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); };
return C;
}());

View File

@@ -0,0 +1,7 @@
=== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration2_es6.ts ===
class C {
>C : Symbol(C, Decl(MemberFunctionDeclaration2_es6.ts, 0, 0))
public * foo() { }
>foo : Symbol(C.foo, Decl(MemberFunctionDeclaration2_es6.ts, 0, 9))
}

View File

@@ -0,0 +1,7 @@
=== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration2_es6.ts ===
class C {
>C : C
public * foo() { }
>foo : () => PseudoIterableIterator<any>
}

View File

@@ -1,12 +1,9 @@
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration3_es6.ts(2,4): error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration3_es6.ts(2,6): error TS2304: Cannot find name 'foo'.
==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration3_es6.ts (2 errors) ====
==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration3_es6.ts (1 errors) ====
class C {
*[foo]() { }
~
!!! error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
~~~
!!! error TS2304: Cannot find name 'foo'.
}

View File

@@ -4,9 +4,38 @@ class C {
}
//// [MemberFunctionDeclaration3_es6.js]
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t;
return { next: verb(0), "throw": verb(1), "return": verb(2), __iterator__: function () { return this; } };
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var C = (function () {
function C() {
}
C.prototype[foo] = function* () { };
C.prototype[foo] = function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); };
return C;
}());

View File

@@ -4,9 +4,38 @@ class C {
}
//// [MemberFunctionDeclaration4_es6.js]
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t;
return { next: verb(0), "throw": verb(1), "return": verb(2), __iterator__: function () { return this; } };
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var C = (function () {
function C() {
}
C.prototype. = function* () { };
C.prototype. = function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); };
return C;
}());

View File

@@ -1,9 +0,0 @@
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration7_es6.ts(2,4): error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration7_es6.ts (1 errors) ====
class C {
*foo<T>() { }
~
!!! error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
}

View File

@@ -4,9 +4,38 @@ class C {
}
//// [MemberFunctionDeclaration7_es6.js]
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t;
return { next: verb(0), "throw": verb(1), "return": verb(2), __iterator__: function () { return this; } };
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var C = (function () {
function C() {
}
C.prototype.foo = function* () { };
C.prototype.foo = function () { return __generator(this, function (_a) {
return [2 /*return*/];
}); };
return C;
}());

View File

@@ -0,0 +1,8 @@
=== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration7_es6.ts ===
class C {
>C : Symbol(C, Decl(MemberFunctionDeclaration7_es6.ts, 0, 0))
*foo<T>() { }
>foo : Symbol(C.foo, Decl(MemberFunctionDeclaration7_es6.ts, 0, 9))
>T : Symbol(T, Decl(MemberFunctionDeclaration7_es6.ts, 1, 8))
}

View File

@@ -0,0 +1,8 @@
=== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration7_es6.ts ===
class C {
>C : C
*foo<T>() { }
>foo : <T>() => PseudoIterableIterator<any>
>T : T
}

View File

@@ -1,11 +1,8 @@
tests/cases/conformance/es6/yieldExpressions/YieldExpression10_es6.ts(1,11): error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
tests/cases/conformance/es6/yieldExpressions/YieldExpression10_es6.ts(2,11): error TS2304: Cannot find name 'foo'.
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression10_es6.ts (2 errors) ====
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression10_es6.ts (1 errors) ====
var v = { * foo() {
~
!!! error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
yield(foo);
~~~
!!! error TS2304: Cannot find name 'foo'.

View File

@@ -6,7 +6,41 @@ var v = { * foo() {
//// [YieldExpression10_es6.js]
var v = { foo: function* () {
yield (foo);
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t;
return { next: verb(0), "throw": verb(1), "return": verb(2), __iterator__: function () { return this; } };
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var v = { foo: function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, (foo)];
case 1:
_a.sent();
return [2 /*return*/];
}
});
}
};

View File

@@ -1,12 +1,9 @@
tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts(2,3): error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts(3,11): error TS2663: Cannot find name 'foo'. Did you mean the instance member 'this.foo'?
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts (2 errors) ====
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts (1 errors) ====
class C {
*foo() {
~
!!! error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
yield(foo);
~~~
!!! error TS2663: Cannot find name 'foo'. Did you mean the instance member 'this.foo'?

View File

@@ -6,11 +6,45 @@ class C {
}
//// [YieldExpression11_es6.js]
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t;
return { next: verb(0), "throw": verb(1), "return": verb(2), __iterator__: function () { return this; } };
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var C = (function () {
function C() {
}
C.prototype.foo = function* () {
yield (foo);
C.prototype.foo = function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, (foo)];
case 1:
_a.sent();
return [2 /*return*/];
}
});
};
return C;
}());

View File

@@ -1,7 +0,0 @@
tests/cases/conformance/es6/yieldExpressions/YieldExpression13_es6.ts(1,9): error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression13_es6.ts (1 errors) ====
function* foo() { yield }
~
!!! error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.

View File

@@ -2,4 +2,38 @@
function* foo() { yield }
//// [YieldExpression13_es6.js]
function* foo() { yield; }
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t;
return { next: verb(0), "throw": verb(1), "return": verb(2), __iterator__: function () { return this; } };
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
function foo() { return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/];
case 1:
_a.sent();
return [2 /*return*/];
}
}); }

View File

@@ -0,0 +1,4 @@
=== tests/cases/conformance/es6/yieldExpressions/YieldExpression13_es6.ts ===
function* foo() { yield }
>foo : Symbol(foo, Decl(YieldExpression13_es6.ts, 0, 0))

View File

@@ -0,0 +1,5 @@
=== tests/cases/conformance/es6/yieldExpressions/YieldExpression13_es6.ts ===
function* foo() { yield }
>foo : () => PseudoIterableIterator<any>
>yield : any

View File

@@ -1,11 +1,8 @@
tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts(1,9): error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts(3,5): error TS1163: A 'yield' expression is only allowed in a generator body.
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts (2 errors) ====
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts (1 errors) ====
function* foo() {
~
!!! error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
function bar() {
yield foo;
~~~~~

View File

@@ -6,8 +6,38 @@ function* foo() {
}
//// [YieldExpression16_es6.js]
function* foo() {
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t;
return { next: verb(0), "throw": verb(1), "return": verb(2), __iterator__: function () { return this; } };
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
function foo() {
function bar() {
yield foo;
}
return __generator(this, function (_a) {
return [2 /*return*/];
});
}

View File

@@ -1,16 +0,0 @@
tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts(1,9): error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts(3,13): error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts (2 errors) ====
function*foo() {
~
!!! error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
function bar() {
function* quux() {
~
!!! error TS1220: Generators are only available when targeting ECMAScript 2015 or higher.
yield(foo);
}
}
}

View File

@@ -8,10 +8,47 @@ function*foo() {
}
//// [YieldExpression19_es6.js]
function* foo() {
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t;
return { next: verb(0), "throw": verb(1), "return": verb(2), __iterator__: function () { return this; } };
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
function foo() {
function bar() {
function* quux() {
yield (foo);
function quux() {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, (foo)];
case 1:
_a.sent();
return [2 /*return*/];
}
});
}
}
return __generator(this, function (_a) {
return [2 /*return*/];
});
}

View File

@@ -0,0 +1,15 @@
=== tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts ===
function*foo() {
>foo : Symbol(foo, Decl(YieldExpression19_es6.ts, 0, 0))
function bar() {
>bar : Symbol(bar, Decl(YieldExpression19_es6.ts, 0, 16))
function* quux() {
>quux : Symbol(quux, Decl(YieldExpression19_es6.ts, 1, 18))
yield(foo);
>foo : Symbol(foo, Decl(YieldExpression19_es6.ts, 0, 0))
}
}
}

View File

@@ -0,0 +1,17 @@
=== tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts ===
function*foo() {
>foo : () => PseudoIterableIterator<any>
function bar() {
>bar : () => void
function* quux() {
>quux : () => PseudoIterableIterator<() => PseudoIterableIterator<any>>
yield(foo);
>yield(foo) : any
>(foo) : () => PseudoIterableIterator<any>
>foo : () => PseudoIterableIterator<any>
}
}
}

Some files were not shown because too many files have changed in this diff Show More