YieldExpression:yield*AssignmentExpression
...
4. Let received be NormalCompletion(undefined).
May it update to 4. Let received be NormalCompletion(LastYieldValue) so we can satisfy:
function *g1() {
yield function.sent
}
function *g2() {
yield* g1()
}
g2().next(42) // => {value:42}
But allow delegate generator access the last yield value also have dark side:
function* service() {
const token = function.sent
if (auth(token)) {
yield* serviceOf3rdParty()
}
}
const serv = service()
serv.next('my-secret-token')
May it update to
4. Let received be NormalCompletion(LastYieldValue)so we can satisfy:But allow delegate generator access the last yield value also have dark side: