Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upEditorial: enable built-in async and sync generator functions to be specified #1665
Conversation
ljharb
reviewed
Aug 11, 2019
|
Would it be perhaps helpful in demonstrating the change to refactor the matchAll iterator algorithm steps to be a built-in generator function? |
This comment has been minimized.
This comment has been minimized.
|
@ljharb here's what i think
|
This comment has been minimized.
This comment has been minimized.
|
Actually, we might need to add a |
This comment has been minimized.
This comment has been minimized.
|
Why couldn't we do it now? The only observable part is the toString's |
This comment has been minimized.
This comment has been minimized.
|
@ljharb because RegExpStringIteratorPrototype is observable, we can't stop having the function return it. |
This comment has been minimized.
This comment has been minimized.
|
ahhh right, so to make this PR maximally useful, we'd have to have a way to control the [[Prototype]] of the returned iterator (since we'd want to use this approach on all the iterators in the spec, i'd think) |
devsnek commentedAug 11, 2019
•
edited
This is a precursor to https://github.com/tc39/proposal-iterator-helpers, and probably can be integrated into that proposal at some point, but I wanted to get some feedback on this approach before then. I think this change is definitely worth exploring for the purpose of the clarity and maintainability of the specification. You can compare the current iterator methods (https://tc39.es/proposal-iterator-helpers) with what the spec text looks like with this change: