On Mon, Apr 22, 2013 at 2:45 PM, Sam Tobin-Hochstadt <[email protected]> wrote:
> What exactly would be the semantic difference between this and just using
> 'yield'?

The semantic difference is that 'yield' pauses your execution and
gives control to the calling code, while 'await' pauses your execution
and gives control to the promise.  Completely different direction of
control-passing.

It so happens that you can use an async manager wrapped around your
function to make the first look like the second, but that doesn't mean
they're the same thing, and it doesn't mean that we want to adopt that
kind of semantic for the language itself.

~TJ
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to