babel/test/fixtures/traceur/Yield/ForLexicallyNestedGenerator.js
2015-01-04 19:40:09 +11:00

16 lines
400 B
JavaScript

function* forLexicallyNestedGenerator() {
yield* (function*() { yield [1,2,3]; yield* [4,5,6]; })();
}
function accumulate(iterator) {
var result = '';
for (var value of iterator) {
result = result + String(value);
}
return result;
}
// ----------------------------------------------------------------------------
assert.equal('1,2,3456', accumulate(forLexicallyNestedGenerator()));