Promises: final steps

Kevin Smith zenparsing at
Thu Sep 5 12:50:51 PDT 2013

> 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 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list