Legitimate uses of IIFEs?

Fabrício Matté ultcombo at gmail.com
Sat Dec 19 22:46:26 UTC 2015

On Sat, Dec 19, 2015 at 8:10 PM, <bread at mailed.me.uk> wrote:

> I believe await* has gone from the spec. The correct form would be (at the
> top-level):

True, I guess `await*` never made it to the proposal's formal text. It
still worked in Babel the last time I checked, though. FWIW, `await* []`
would desugar to `await Promise.all([])`.

> The mistake in Dimitry's example is that the async body was not resolved,
> not that anonymous async functions are in some way invalid - they're just
> fine.

I'm not sure if I understand what you mean. I see that the outer
synchronous function would not await until the async function finished—i.e.
the outer function would return before the promise was resolved/settled—,
but that is still valid syntax—you could be running the async code for
side-effects that the caller context does not need to be aware of. You
mentioned this was invalid syntax, and that was the initial point I
addressed. :)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20151219/b9911db5/attachment.html>

More information about the es-discuss mailing list