答复: Proposal: use "One More Point" to handle async functions

Li Xiaolong 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.

 

> How?

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
 <https://mail.mozilla.org/listinfo/es-discuss> https://mail.mozilla.org/listinfo/es-discuss

 

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


More information about the es-discuss mailing list