47 lines
1,000 B
Text
47 lines
1,000 B
Text
=== tests/cases/conformance/es6/spread/iteratorSpreadInCall11.ts ===
|
|
foo(...new SymbolIterator);
|
|
>foo(...new SymbolIterator) : symbol
|
|
>foo : <T>(...s: T[]) => T
|
|
>...new SymbolIterator : symbol
|
|
>new SymbolIterator : SymbolIterator
|
|
>SymbolIterator : typeof SymbolIterator
|
|
|
|
function foo<T>(...s: T[]) { return s[0] }
|
|
>foo : <T>(...s: T[]) => T
|
|
>T : T
|
|
>s : T[]
|
|
>T : T
|
|
>s[0] : T
|
|
>s : T[]
|
|
>0 : number
|
|
|
|
class SymbolIterator {
|
|
>SymbolIterator : SymbolIterator
|
|
|
|
next() {
|
|
>next : () => { value: symbol; done: boolean; }
|
|
|
|
return {
|
|
>{ value: Symbol(), done: false } : { value: symbol; done: boolean; }
|
|
|
|
value: Symbol(),
|
|
>value : symbol
|
|
>Symbol() : symbol
|
|
>Symbol : SymbolConstructor
|
|
|
|
done: false
|
|
>done : boolean
|
|
>false : boolean
|
|
|
|
};
|
|
}
|
|
|
|
[Symbol.iterator]() {
|
|
>Symbol.iterator : symbol
|
|
>Symbol : SymbolConstructor
|
|
>iterator : symbol
|
|
|
|
return this;
|
|
>this : SymbolIterator
|
|
}
|
|
}
|