答复: Proposal: use "One More Point" to handle async functions
898310778 at outlook.com
Tue Sep 27 16:24:06 UTC 2016
> That’s not necessarily true — `await` in modules may be very different from this.
I don’t know what await in modules look like.
> You might be confused about something — if an awaited Promise is rejected, the async function can be resumed from a catch block to handle the rejection.
I know await can be catched. But the redundant reject state in promise makes it more confusing.
> I’m not sure everyone shares this view — many people laud other languages where coroutines (for example) are indistinguishable from regular subroutines.
Well, when you are debugging and can’t find where the code waits, you’ll miss the OMP.
I thought it again. Can I write: ‘await obj2.doSomeOtherThing(await obj1.doSomeThing())’? If I can, then the await is not more complex than OMP when dealing with deep async, just a little longer.
es-discuss mailing list
<mailto:es-discuss at mozilla.org> es-discuss at mozilla.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss