mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
22 lines
466 B
TypeScript
22 lines
466 B
TypeScript
//// [tests/cases/conformance/es6/for-ofStatements/for-of14.ts] ////
|
|
|
|
//// [for-of14.ts]
|
|
class MyStringIterator {
|
|
next() {
|
|
return "";
|
|
}
|
|
}
|
|
|
|
var v: string;
|
|
for (v of new MyStringIterator) { } // Should fail because the iterator is not iterable
|
|
|
|
//// [for-of14.js]
|
|
"use strict";
|
|
class MyStringIterator {
|
|
next() {
|
|
return "";
|
|
}
|
|
}
|
|
var v;
|
|
for (v of new MyStringIterator) { } // Should fail because the iterator is not iterable
|