mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
Address PR feedback
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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.
|
||||
7
tests/baselines/reference/ES5For-ofTypeCheck12.js
Normal file
7
tests/baselines/reference/ES5For-ofTypeCheck12.js
Normal 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];
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
//@target: ES5
|
||||
for (const v of 0) { }
|
||||
Reference in New Issue
Block a user