Re: Promises: final steps

Kevin Smith <[email protected]>
Newsgroups gmane.comp.lang.javascript.ecmascript4.general,gmane.comp.web.dom.general
Message-ID <CA+mDt2zfNTY12fr87j-nBPbS_XKUgrT1ruiQ+twY1TpL=0Thtw@mail.gmail.com>
> Please do.
>

You're not going to like it, which will explain my hesitation : )

Think of all promises as existing in a forest, where "root" promises are
created using the Promise constructor and "child" promises are created
using `then`.  Promises with [[Value]] set are green.  Promises with
[[Reason]] set are red.  A "checkpoint" occurs immediately after the
microtask queue has been completely flushed.  At any checkpoint, any
non-root leaf nodes colored red are program errors.

This forces the programmer (me, really) to either write an error handler at
the end of a `then` chain, or to return the chain to a caller that will.
 It also means that I must be strict about when error handlers are attached
to a chain.  There may be important use cases that this strategy precludes
which I haven't yet considered...

{ Kevin }

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.