-
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
Editorial: Introduce AO combining IteratorStep and IteratorValue #3268
Conversation
spec.html
Outdated
1. If _next_ is ~done~, return _list_. | ||
1. Append _next_ to _list_. |
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.
should all of these have an assertion that next
is an ECMAScript language value?
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.
Eh, I don't think it's necessary. It's not hard to tell given the type of IteratorStepValue.
d4a4230
to
be7ec12
Compare
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.
This is great.
Okay. That form isn't defined in 5.2.3.4, but the meaning is pretty clear. (Throw it on the pile for PR #1573.) |
Fun fact: this eliminates 24 of the 28 explicit uses of the It's tempting to remove it entirely, and replace #1573 with a direct definition of |
1. Return _groups_. | ||
1. Let _value_ be ? IteratorValue(_next_). | ||
1. Let _value_ be _next_. |
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 would've just never introduced next
, but this is fine.
6ed5639
to
12d3687
Compare
"IteratorStepValue" isn't a great name, but I'm worried that sticking with IteratorStep will lead to a bunch of confusing documentation/comments, so I didn't want to reuse it.
In the cases which deal with completion records explicitly you might have to think for a second to convince yourself the change doesn't actually affect behavior.
The only 2 remaining uses of IteratorStep are in the elisions in
[a, /* hole */, b] = iterable
. Ordinarily I'd inline it into those and delete the AO, but I want to update 402 and proposals to use the new AO before doing that.There are still 8 uses of IteratorValue: 7 in
yield*
, 1 in the AsyncFromSyncIterator wrapper.yield*
could probably use a cleanup too, but not in this PR.