2015-02-24 04:07:45 +01:00
|
|
|
//// [for-of17.ts]
|
|
|
|
var v: string;
|
|
|
|
for (v of new NumberIterator) { } // Should succeed
|
|
|
|
|
|
|
|
class NumberIterator {
|
|
|
|
next() {
|
|
|
|
return {
|
|
|
|
value: 0,
|
|
|
|
done: false
|
|
|
|
};
|
|
|
|
}
|
|
|
|
[Symbol.iterator]() {
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//// [for-of17.js]
|
|
|
|
var v;
|
2015-03-09 02:23:23 +01:00
|
|
|
for (v of new NumberIterator) {
|
|
|
|
} // Should succeed
|
2015-03-16 05:27:54 +01:00
|
|
|
class NumberIterator {
|
|
|
|
next() {
|
2015-02-24 04:07:45 +01:00
|
|
|
return {
|
|
|
|
value: 0,
|
|
|
|
done: false
|
|
|
|
};
|
2015-03-16 05:27:54 +01:00
|
|
|
}
|
|
|
|
[Symbol.iterator]() {
|
2015-02-24 04:07:45 +01:00
|
|
|
return this;
|
2015-03-16 05:27:54 +01:00
|
|
|
}
|
|
|
|
}
|