Aah, good to know. With Babel this isn't the case, as `await null` doesn't
defer, so I was doing `await somethingThatMightBeNull` to possibly defer,
but `if (somethingThatMightBeNull) await somethingThatMightBeNull` will be
full proof if Babel fixes that.

On Sunday, February 7, 2016, Mark S. Miller <erig...@google.com> wrote:

>
>
> On Sun, Feb 7, 2016 at 1:51 PM, Kris Kowal <kris.ko...@cixar.com
> <javascript:_e(%7B%7D,'cvml','kris.ko...@cixar.com');>> wrote:
>
>> Await yields to the event loop unconditionally. This is useful for
>> spreading CPU-bound work across multiple events. You can explicitly await
>> conditionally.
>>
>> ```
>> if (guard) { await guard; }
>> ```
>>
>
> Good example, thanks.
>
>
>
>>
>> On Sun, Feb 7, 2016 at 1:39 PM /#!/JoePea <j...@trusktr.io
>> <javascript:_e(%7B%7D,'cvml','j...@trusktr.io');>> wrote:
>>
>>> I'm not sure where's the best place to ask, but if I
>>>
>>> ```
>>> await null
>>> ```
>>>
>>> in an async function does that guarantee that the following code will
>>> execute immediately (control flow will not go anywhere else)?
>>>
>>> - Joe
>>> _______________________________________________
>>> es-discuss mailing list
>>> es-discuss@mozilla.org
>>> <javascript:_e(%7B%7D,'cvml','es-discuss@mozilla.org');>
>>> https://mail.mozilla.org/listinfo/es-discuss
>>>
>>
>> _______________________________________________
>> es-discuss mailing list
>> es-discuss@mozilla.org
>> <javascript:_e(%7B%7D,'cvml','es-discuss@mozilla.org');>
>> https://mail.mozilla.org/listinfo/es-discuss
>>
>>
>
>
> --
>     Cheers,
>     --MarkM
>


-- 
/#!/JoePea
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to