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
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 })
2 matches
Mail list logo