mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
35 lines
668 B
TypeScript
35 lines
668 B
TypeScript
//// [tests/cases/conformance/es6/spread/iteratorSpreadInCall11.ts] ////
|
|
|
|
//// [iteratorSpreadInCall11.ts]
|
|
function foo<T>(...s: T[]) { return s[0] }
|
|
class SymbolIterator {
|
|
next() {
|
|
return {
|
|
value: Symbol(),
|
|
done: false
|
|
};
|
|
}
|
|
|
|
[Symbol.iterator]() {
|
|
return this;
|
|
}
|
|
}
|
|
|
|
foo(...new SymbolIterator);
|
|
|
|
//// [iteratorSpreadInCall11.js]
|
|
"use strict";
|
|
function foo(...s) { return s[0]; }
|
|
class SymbolIterator {
|
|
next() {
|
|
return {
|
|
value: Symbol(),
|
|
done: false
|
|
};
|
|
}
|
|
[Symbol.iterator]() {
|
|
return this;
|
|
}
|
|
}
|
|
foo(...new SymbolIterator);
|