support async generators with ->>* #1063
Conversation
Beautiful ascii art, as expected |
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.
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.