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