* Improve typing for Generators and Async Generators * Add TReturn and TNext to Iterator, IterableIterator, etc. * Update ts internal Iterator to be assignable from global Iterator * Make 'done' optional in IteratorYieldResult * Revert Iterable and IterableIterator to simpler versions plus other fixes * Add additional inference tests * Added additional tests * PR cleanup and minor async iteration type fix * Updated diagnostics message and added non-strict tests * Fix expected arity of Iterator/AsyncIterator
36 lines
710 B
Text
36 lines
710 B
Text
=== tests/cases/conformance/es6/for-ofStatements/for-of35.ts ===
|
|
class StringIterator {
|
|
>StringIterator : StringIterator
|
|
|
|
next() {
|
|
>next : () => any
|
|
|
|
return {
|
|
>{ done: true, value: v } : { done: boolean; value: any; }
|
|
|
|
done: true,
|
|
>done : boolean
|
|
>true : true
|
|
|
|
value: v
|
|
>value : any
|
|
>v : any
|
|
}
|
|
}
|
|
|
|
[Symbol.iterator]() {
|
|
>[Symbol.iterator] : () => this
|
|
>Symbol.iterator : symbol
|
|
>Symbol : SymbolConstructor
|
|
>iterator : symbol
|
|
|
|
return this;
|
|
>this : this
|
|
}
|
|
}
|
|
|
|
for (var v of new StringIterator) { }
|
|
>v : any
|
|
>new StringIterator : StringIterator
|
|
>StringIterator : typeof StringIterator
|
|
|