Re: Enable async/await to work on functions that don't just return promises.

2017-02-27 Thread Isiah Meadows
I'm guessing you missed the second sentence in my reply about the fact I'm strongly against the original proposal... On Mon, Feb 27, 2017, 17:24 Michał Wadas wrote: > Actually, this proposal would be a revolution and I can think of too many > edge cases to make it viable. > > Consider: > > async

Re: Enable async/await to work on functions that don't just return promises.

2017-02-27 Thread Michał Wadas
Actually, this proposal would be a revolution and I can think of too many edge cases to make it viable. Consider: async function foo() { async function bar() { [1,2,3].forEach(async function() { async return 3; }); } return (await bar()) + 39; } What does

Re: Enable async/await to work on functions that don't just return promises.

2017-02-27 Thread Isiah Meadows
I was speaking objectively about the proposal itself, and the scope of it. I'm personally strongly against it for reasons I stated earlier in the thread (the status quo is better IMHO). I was just trying to direct people back to the actual scope of the proposal instead of basically reinventing asyn

Re: Enable async/await to work on functions that don't just return promises.

2017-02-27 Thread Tab Atkins Jr.
On Mon, Feb 27, 2017 at 12:41 AM, Isiah Meadows wrote: > May I add one more thing: the main topic this was about is adapting > non-standard async APIs (like Node's error-first callback idiom) to the land > of promises. Async functions and iterators are incredibly useful when you're > dealing with

Re: Enable async/await to work on functions that don't just return promises.

2017-02-27 Thread Andy Earnshaw
I had a similar thought a while ago for adapting non-promise functions, by way of `async.resolve()` and `async.reject()`: ```javascript async function asyncFunction() { someAsync('data', (err, data) => { if (err) async.reject(err); async.resolve(data); }) } ``` This differ

Re: Enable async/await to work on functions that don't just return promises.

2017-02-27 Thread Isiah Meadows
May I add one more thing: the main topic this was about is adapting non-standard async APIs (like Node's error-first callback idiom) to the land of promises. Async functions and iterators are incredibly useful when you're dealing with just promises, especially consuming them, but this is about crea

Re: Standardize global `setTimeout`/etc.?

2017-02-27 Thread Isiah Meadows
Okay. Never mind, then. On Sun, Feb 26, 2017, 08:42 Andrea Giammarchi wrote: > What I meant, is that I don't think it'd be wise to duplicate DOM > standards on the ES side or, even worse, create specification > incompatibilities. > > Timers are just the top of the iceberg, IMO > > On Sun, Feb 26