mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
33 lines
585 B
TypeScript
33 lines
585 B
TypeScript
//// [tests/cases/conformance/es6/for-ofStatements/for-of31.ts] ////
|
|
|
|
//// [for-of31.ts]
|
|
class MyStringIterator {
|
|
next() {
|
|
return {
|
|
// no done property
|
|
value: ""
|
|
}
|
|
}
|
|
|
|
[Symbol.iterator]() {
|
|
return this;
|
|
}
|
|
}
|
|
|
|
for (var v of new MyStringIterator) { }
|
|
|
|
//// [for-of31.js]
|
|
"use strict";
|
|
class MyStringIterator {
|
|
next() {
|
|
return {
|
|
// no done property
|
|
value: ""
|
|
};
|
|
}
|
|
[Symbol.iterator]() {
|
|
return this;
|
|
}
|
|
}
|
|
for (var v of new MyStringIterator) { }
|