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 following the spec draft. Specifically, I believe the call to the async function lands at https://tc39.github.io/ecmascript-asyncawait/#async-decls-exprs-EvaluateBody which calls https://tc39.github.io/ecmascript-asyncawait/#abstract-ops-async-function-start which in step 5 synchronously "resumes evaluation".

In terms of specification, that's a question for TC39, though afaik they modeled their stuff after Task.js to some extent, so that may be where the behavior is coming from.

I haven't found any regression test for this in our implementation, and
I guess we should add one either way.

Please file a SpiderMonkey bug? This should probably be covered in test262 as well, if it's not already....

-Boris
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to