You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 10, 2019. It is now read-only.
There is the edge case of what to do with functions thrown before an await statement to take into account. It's some time ago I looked it up in the spec, but I think the correct behaviour is to make these too reject the promise instead of returning an error. That would make the total code required be something like this instead:
Doing it that way would also keep the code generation easier since there wouldn't be two return styles to handle (resolve/reject calls vs. return/throw).
I hadn't really thought of these semantics before, but curious: should 1 log before 2 if you aren't awaiting foo's call? I guess said another way, should there be a difference in logging the values if the code is:
foo();console.log(2);
versus:
awaitfoo();console.log(2);
Apologies if this seems obvious, but I wanted to verify behavior.
should transpile to:
which should log 1, then 2.
but instead transpiles to:
This difference means the async function takes an extra tick - which results in logging 2, then 1.
The text was updated successfully, but these errors were encountered: