for await & Readable
Hi, I am trying to consume a readable with a for await loop.
When I create the simple stream below, the console output the error straight away instead of logging the data events first. Is it the expected behavior
Version: v12.9.1
Platform: Darwin Kernel Version 18.7.0
const { Readable } = require('stream') async function* generate() { yield 1 yield 2 yield Promise.reject('Boum') } ;(async () => { try { for await (const d of Readable.from(generate())) { console.log(d) } } catch (e) { console.log(e) } })()
the output is
instead of the expected