2015-02-25 01:09:58 +01:00
|
|
|
//// [for-of30.ts]
|
|
|
|
for (var v of new StringIterator) { }
|
|
|
|
|
|
|
|
class StringIterator {
|
|
|
|
next() {
|
|
|
|
return {
|
|
|
|
done: false,
|
|
|
|
value: ""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return = 0;
|
|
|
|
|
|
|
|
[Symbol.iterator]() {
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//// [for-of30.js]
|
2015-03-09 02:23:23 +01:00
|
|
|
for (var v of new StringIterator) {
|
|
|
|
}
|
2015-02-25 01:09:58 +01:00
|
|
|
var StringIterator = (function () {
|
|
|
|
function StringIterator() {
|
|
|
|
this.return = 0;
|
|
|
|
}
|
|
|
|
StringIterator.prototype.next = function () {
|
|
|
|
return {
|
|
|
|
done: false,
|
|
|
|
value: ""
|
|
|
|
};
|
|
|
|
};
|
|
|
|
StringIterator.prototype[Symbol.iterator] = function () {
|
|
|
|
return this;
|
|
|
|
};
|
|
|
|
return StringIterator;
|
|
|
|
})();
|