Re: Scheduling of async functions

2016-11-10 Thread Boris Zbarsky
On 11/10/16 7:25 AM, Paolo Amadini wrote: Is it a deliberate choice that the first chunk of an async function is executed synchronously instead of waiting for the next microtask? In terms of implementation or specification? In terms of implementation, I think it's deliberate in the sense of

Scheduling of async functions

2016-11-10 Thread Paolo Amadini
Take the following code example: someCondition = false; async function onClick(event) { if (someCondition) { await Promise.resolve(); // Or any other async function. } event.stopPropagation(); } let called = false; onClick({ stopPropagation: () => called = true })