Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
change how ReturnIfAbrupt and its shorthands are specified #1573
base: main
Are you sure you want to change the base?
change how ReturnIfAbrupt and its shorthands are specified #1573
Changes from 7 commits
c8f2f8f
4961d80
2bc60be
4be238d
facbb12
c92bade
e17ee93
f371c80
c06aefa
8a121c3
ea5d20d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than having 2 definitions, discriminated by the form of the argument, you could have one definition with a generalized argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it's a structural rewrite, I'd like to keep it as simple as I can. Though one could argue that 1 rewrite rule is simpler overall than 2 individually simpler rewrite rules. I'll leave that one up to @tc39/ecma262-editors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 seems probably simpler, but totes fine to do that in a followup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've reduced the ReturnIfAbrupt definition to a single macro expansion, though it now has the peculiarity that, when used on an alias, as in
ReturnIfAbrupt(_someAlias_)
, we are left with a step at the end that just references the alias. I think that's probably fine, but it may not be clear to everyone that that is meant to be a no-op. Let me know if you want me to switch it back to 2 expansions, I'm not tied to a particular choice.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this as a single expansion. I think the "step at the end that just references the alias" thing is unlikely to trip up readers, but if we're worried, we could say "the last line is omitted if
*[before]*
is not present" (or "is empty" or whatever).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if we need to call out
Perform
(ie,Perform ? Op()
orPerform ! Op()
), or if that's a topic for a different PR.