Closed
Description
Version 2.1.0-dev.20161031
const g = function*(){
yield 1;
}
console.log([...g()]);
Compiles to the following which throws an error (treating the generator as an array, not an iterable):
var g = function* () {
yield 1;
};
console.log(g().slice());
//# sourceMappingURL=build.js.map
Possible solution using Array.from
:
var g = function* () {
yield 1;
};
console.log(Array.from(g()).slice());
//# sourceMappingURL=build.js.map
Metadata
Metadata
Assignees
Labels
No labels