On Fri, Jul 17, 2015 at 10:33 AM, Kevin Smith <[email protected]> wrote:

> I know the spec for this isn't finalized, but what is the current
>> direction for the behaviour when await is used on a function that is not
>> marked async and doesn't return a Promise? Should it run immediately or
>> wait for the next turn of the event loop?
>>
>
> More generally, the question is: what should await do for non-promises?
>
>     await 1;
>
> Should it force a job to be queued?
>


Yes, absolutely. It must be equivalent to
Promise.resolve(1).then(..success-continuation-of-await..,
..error-continuation-of-await..)
though of course for the original bindings of Promise.resolve and .then
rather than the current bindings.


-- 
    Cheers,
    --MarkM
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to