The `yield *` expression actually *evaluates* to the final value of the
delegated generator (i.e., the final value when *done* is *true*).
In other words, if you modified your second generator in your example to
the following:
function* b() {
const result = yield* a();
>or it need to return {value: {value: "end", done: true}, done: true}
this case is supported, seems, if to use:
function* b() {
return yield* a()
}
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
generator function shouldn't allow a "return value" when use yield or it
need to return {value: {value: "end", done: true}, done: true} at the iter
end when use yield*
code:
``` javascript
function* a() {
yield 1;
yield 2;
return "end"
}
//undefined
function* b() {
yield* a()
}
//undefined
c =
3 matches
Mail list logo