ecma262 icon indicating copy to clipboard operation
ecma262 copied to clipboard

use normal completions in ACs passed to CreateIteratorFromClosure when possible

Open michaelficarra opened this issue 7 months ago • 2 comments

CreateIteratorFromClosure passes the AC to GeneratorStart which treats any normal completion return value the same as a ReturnCompletion(*undefined*). It seems better to me to use NormalCompletion(~unused~) in these locations and only return a return completion if we want to use a value other than *undefined*.

michaelficarra avatar May 15 '25 00:05 michaelficarra

I don't like that we have this degree of freedom. We should pick one and stick with it, and ensure the machinery only supports that kind. I'll prepare some PRs so we can see what the machinery would look like in each case.

bakkot avatar May 15 '25 01:05 bakkot

PRs: https://github.com/tc39/ecma262/pull/3605 / https://github.com/tc39/ecma262/pull/3606.

I didn't do the actual changes to the ACs; that can wait until we decide which way we want to go. My preference is https://github.com/tc39/ecma262/pull/3606.

bakkot avatar May 15 '25 02:05 bakkot