Address PR feedback

This commit is contained in:
Jason Freeman
2015-03-12 14:56:58 -07:00
parent 22f80b9582
commit 6691408147
7 changed files with 73 additions and 19 deletions

View File

@@ -1,11 +1,11 @@
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck10.ts(1,15): error TS2461: Type 'StringIterator' is not an array type.
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck10.ts(1,15): error TS2461: Type 'StringIterator' is not an array type or a string type.
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 TS2461: Type 'StringIterator' is not an array type.
!!! error TS2461: Type 'StringIterator' is not an array type or a string type.
// In ES3/5, you cannot for...of over an arbitrary iterable.
class StringIterator {

View File

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

View File

@@ -0,0 +1,7 @@
//// [ES5For-ofTypeCheck12.ts]
for (const v of 0) { }
//// [ES5For-ofTypeCheck12.js]
for (var _i = 0, _a = 0; _i < _a.length; _i++) {
var v = _a[_i];
}

View File

@@ -0,0 +1,2 @@
//@target: ES5
for (const v of 0) { }