-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Editorial: remove ReturnIfAbrupt and specify ! and ? directly #3705
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
Conversation
|
The rendered spec for this PR is available at https://tc39.es/ecma262/pr/3705. |
|
Can you draft a change to the Editorial Conventions document about not relying on this evaluation order under normal circumstances and post it here? |
|
Sure, how about:
|
michaelficarra
left a comment
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.
The excessive hand-waviness is making me a little uncomfortable. It's not 100% clear which parts of Let _result_ be ? _record_ and Let _result_ be ! _record_ are essential and which are nonessential. I don't think we need to go the full rewrite approach I took in my PR, but maybe it'd be clearer if we included a second example for each using, e.g., Perform with an AO invocation. And we should say explicitly that it's not limited to these exact forms, but any steps using ? and ! get a corresponding transform.
|
I can definitely add another example. I don't want to use
That's the intention of the bit which says
I don't know what you're asking for that isn't already covered by this sentence. |
No explanation needed,
To me, the only thing that sentence is trying to communicate is that algorithm steps that do more than one thing should be treated as a series of algorithm steps that accomplishes the same thing when applying this transform. It doesn't say anything about steps not looking literally like |
The problem is that after the rewrite there's a step which reads
Applying the specific transform described in the Evaluation Order section will ultimately result in a step which looks literally like |
3698bd3 to
70b0872
Compare
The
?and!shorthands have long been under-specified, as discussed in #1570, this thread, etc. Also, as of recent efforts (#1571, #2744, #2924, #3268, etc) there are no longer any uses ofReturnIfAbruptexcept to define?. So removeReturnIfAbrupt. Instead, as proposed in this comment, specify evaluation order as a (handwavy, but hopefully clear) rewrite rule, and then define?and!directly, with nontrivial cases handled by first applying the rewrite rule.I checked ECMA-402, HTML, streams, and Wasm, and found no uses of
ReturnIfAbrupt. There are still some uses in proposals, but whatever.Closes #1570 and #1573.