ES6,ES7,ES8 and beyond. A Proposed Roadmap.

Tab Atkins Jr. jackalmage at gmail.com
Mon Apr 22 16:31:47 PDT 2013


On Mon, Apr 22, 2013 at 2:45 PM, Sam Tobin-Hochstadt <samth at ccs.neu.edu> 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


More information about the es-discuss mailing list