Closed js-choi closed 2 years ago
I'm confused why this is necessary - what else would a "return" statement do in an abstract closure?
It returns a value to the caller. The caller, in this case, is step 3.b.ii of AsyncBlockStart. You can look at the following steps to see that a.) the caller expects the result to be a Completion Record, not a bare value and b.) if the caller got a normal completion, it would not do the right thing.
"Return" in an abstract closure is mostly unrelated to return
ing from an ES function, which is handled by a different mechanism.
Resolves #31, at least temporarily. (Also affects #14.)
Eventually we might want to make a change to match whatever approach proposal-iterator-helpers does; see tc39/proposal-iterator-helpers#218. But that should be able to be a mere editorial change.