On Tue 23 Apr 2013 01:31, "Tab Atkins Jr." <[email protected]> writes:
> 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 seems quite unlikely that modern JS implementations would implement `await' as you describe it. It's relatively easy to suspend computation in one function frame, which is why we can have nice things like yield. Suspending multiple function activations is done in some language environments, but it would be difficult to retrofit into JS implementations, which is why we can't have nice things like await. My 2c. Andy _______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

