2015-01-04 19:40:09 +11:00

15 lines
252 B
JavaScript

function* G() {
yield 'hi';
yield 'there';
}
function f(...args) {
return args;
}
var result = f(0, ...[1, 2], 3, ...G());
assertArrayEquals([0, 1, 2, 3, 'hi', 'there'], result);
result = f(...G());
assertArrayEquals(['hi', 'there'], result);