71 lines
1.5 KiB
Text
71 lines
1.5 KiB
Text
=== tests/cases/conformance/es6/spread/iteratorSpreadInArray2.ts ===
|
|
var array = [...new NumberIterator, ...new SymbolIterator];
|
|
>array : (number | symbol)[]
|
|
>[...new NumberIterator, ...new SymbolIterator] : (number | symbol)[]
|
|
>...new NumberIterator : number
|
|
>new NumberIterator : NumberIterator
|
|
>NumberIterator : typeof NumberIterator
|
|
>...new SymbolIterator : symbol
|
|
>new SymbolIterator : SymbolIterator
|
|
>SymbolIterator : typeof SymbolIterator
|
|
|
|
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
|
|
}
|
|
}
|
|
|
|
class NumberIterator {
|
|
>NumberIterator : NumberIterator
|
|
|
|
next() {
|
|
>next : () => { value: number; done: boolean; }
|
|
|
|
return {
|
|
>{ value: 0, done: false } : { value: number; done: boolean; }
|
|
|
|
value: 0,
|
|
>value : number
|
|
>0 : number
|
|
|
|
done: false
|
|
>done : boolean
|
|
>false : boolean
|
|
|
|
};
|
|
}
|
|
|
|
[Symbol.iterator]() {
|
|
>Symbol.iterator : symbol
|
|
>Symbol : SymbolConstructor
|
|
>iterator : symbol
|
|
|
|
return this;
|
|
>this : NumberIterator
|
|
}
|
|
}
|