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