-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Return" at end of algorithm: implicit or explicit? #2394
Comments
Good timing, I was about to submit the same issue, because the Temporal proposal uses the same pattern and I wasn't sure if it's actually allowed. 😄 Only the following abstract operations are missing a
|
FWIW, I think I'd prefer adding an explicit (*) Especially when also including the two other equivalent forms |
RequireInternalSlot isn’t supposed to have a return value; it’s only supposed to be used with “Perform”. I would only expect an explicit return in an AO whose return value is used. |
|
I would assume “empty”. It would be very bizarre to me to add an explicit return statement to AOs that shouldn’t be used to provide a value. #1796 would surely make AOs like this not return a completion record at all; even prior to that, my opinion holds. |
Well, no, #1796 would still leave |
Hmm, this bizarreness is pretty common in the spec, though. |
Good point that it’d still need a completion record. |
I think I lean towards adding an explicit One possibility: we could introduce an explicit value, like
bit to say it is I'd consider that an aesthetic improvement to the spec's type system, but I don't know if that would actually justify the increased complexity. Maybe? |
|
I expect #1796 to change the restriction to "anything except a completion record", which would resolve both those cases and this one, yeah. |
The only other ones I found are:
|
Editors discussed this at the call today, and were in favor of my
I'll prepare a PR for this later today. |
Currently, there are some algorithms where, if an 'early' return doesn't occur, control just falls off the end of the steps. The spec doesn't define what this means. Should we define what it means (implicit
Return
step), or add an explicitReturn
to such cases?The text was updated successfully, but these errors were encountered: