Open
Description
This is to add support for generator functions in the Dart Interop Gen project.
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function*
function* generator(i) {
yield i;
yield i + 10;
}
// using the function
const gen = generator(10);
console.log(gen.next().value);
// Expected output: 10
In order for this, we will need to implement Iterator
, AsyncIterator
, Generator
and AsyncGenerator
in our codebase. From their APIs, they end up being more similar to Dart's Iterator
(as they have methods like next()
), but we might consider helpers to convert them to Iterable
and Stream
.
Metadata
Metadata
Assignees
Labels
No labels