2015-02-24 04:07:45 +01:00
|
|
|
//// [for-of18.ts]
|
|
|
|
var v: string;
|
|
|
|
for (v of new StringIterator) { } // Should succeed
|
|
|
|
|
|
|
|
class StringIterator {
|
|
|
|
next() {
|
|
|
|
return {
|
|
|
|
value: "",
|
|
|
|
done: false
|
|
|
|
};
|
|
|
|
}
|
|
|
|
[Symbol.iterator]() {
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//// [for-of18.js]
|
|
|
|
var v;
|
2015-03-09 02:23:23 +01:00
|
|
|
for (v of new StringIterator) {
|
|
|
|
} // Should succeed
|
2015-02-24 04:07:45 +01:00
|
|
|
var StringIterator = (function () {
|
|
|
|
function StringIterator() {
|
|
|
|
}
|
|
|
|
StringIterator.prototype.next = function () {
|
|
|
|
return {
|
|
|
|
value: "",
|
|
|
|
done: false
|
|
|
|
};
|
|
|
|
};
|
|
|
|
StringIterator.prototype[Symbol.iterator] = function () {
|
|
|
|
return this;
|
|
|
|
};
|
|
|
|
return StringIterator;
|
|
|
|
})();
|