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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
support async generators with ->>* #1063
Conversation
Beautiful ascii art, as expected |
8f4335a
to
f848ee4
Compare
Could be more tests from For example: # yield from in let
first = ->>*
i = 0
loop => yield await Promise.resolve i++
second = ->>*
let
await Promise.resolve 1
yield from first!
list = second!
for let i to 3
{value} <- list.next!then
eq value, i (a modified test from However this one # in switch
f7 = (x) ->*
y = switch x
| true => yield await Promise.resolve 1
| _ => yield await Promise.resolve 2
y
g7 = f7 true
g7.next!then -> eq 1 it.value (a modified test from Speaking of which, what do you think about my idea from #1060 (comment) to rewrite Edit: Pardon my foolishness, I forgot to change the arrow ^_^' The test passes. |
Also support the more verbose `async function* named-fn` option.
f848ee4
to
fec1fd6
Compare
There is a test with a Re your |
LGTM |
@rhendric Should I do it on your branch or on master? |
Master, unless you expect it to depend on this work for some reason. |
After some thought I think I'll postpone that indefinitely - the gain isn't that big and And regarding async generators, looks great 馃憤 |
@pepkin88 brought to my attention that async generators are coming down the JS pipe (and already supported by default in Node.js 10.7), and I think they're pretty easy to add at this point and I see no reason to wait. I said I wouldn't prioritize more features for 1.6 but this is a pretty minor and obvious combination of two existing features, so I'm giving myself an exception. 馃槃 Open for comments for two weeks, to be merged on August 13 if there are no opposing voices.
@gkovacs, @summivox, as sponsors of the original async work, if you think I've missed anything here I'm interested in hearing about it.