ecma262
ecma262 copied to clipboard
Editorial: describe behavior for algorithms without a "Return"
Fixes #2394.
I note that this races with two new usages of Return.
in https://github.com/tc39/ecma262/pull/1668, and whichever lands second will need to be rebased. I'm happy to do that myself, I'm just commenting so we don't lose track.
Thinking about this more, we could instead use a new kind of completion record here (just for procedure early exits) that doesn't have a [[Value]]
slot, making the attempt to use the value of an AO that returns it an editorial type error through existing means.
I would prefer not to further complicate the distinction between normal and abrupt completions, I think.
Yeah, I think I agree. We might be able to make some improvements in this area once completion value reform is complete.
This should wait on https://github.com/tc39/ecma262/pull/2413 / https://github.com/tc39/ecma262/pull/2429, which touch several of the same places.
I think, once PR #2547 lands, you won't need this PR any more, because there won't be any algorithms that complete without a Return.
Or I suppose you could say that if it happens it's an editorial error.
If you rebase to main (now that #2547 has landed), I think you'll find that there isn't much left in this PR.
Note that 9.10.3 Execution doesn't have a "Return" step, so you might want to add a Return ~unused~
. On the other hand, it's a weird case, so maybe "Return" doesn't mean anything?
Fixed by #2547 instead.