31 lines
552 B
TypeScript
31 lines
552 B
TypeScript
//// [iteratorSpreadInCall3.ts]
|
|
foo(...new SymbolIterator);
|
|
|
|
function foo(...s: symbol[]) { }
|
|
class SymbolIterator {
|
|
next() {
|
|
return {
|
|
value: Symbol(),
|
|
done: false
|
|
};
|
|
}
|
|
|
|
[Symbol.iterator]() {
|
|
return this;
|
|
}
|
|
}
|
|
|
|
//// [iteratorSpreadInCall3.js]
|
|
foo(...new SymbolIterator);
|
|
function foo(...s) { }
|
|
class SymbolIterator {
|
|
next() {
|
|
return {
|
|
value: Symbol(),
|
|
done: false
|
|
};
|
|
}
|
|
[Symbol.iterator]() {
|
|
return this;
|
|
}
|
|
}
|