Promises: final steps
erights at gmail.com
Thu Sep 5 10:15:29 PDT 2013
On Thu, Sep 5, 2013 at 12:04 PM, Domenic Denicola <
domenic at domenicdenicola.com> wrote:
> From: Kevin Smith [zenparsing at gmail.com]
> > Indeed, for a non-GUI embedding like Node, they *must* be debuggable
> using just a console.
> This is an important point. A provisional idea that preserves our desire
> to not introduce new features to promises themselves, requiring user choice
> at authoring time, might be some kind of `console.unhandledRejections()`
> function which returns you a snapshot of the current unhandled rejections
That would be a global communications channel.
> > Another option is a static method which takes a promise and throws
> rejections ala done:
> > ```js
> > Promise.throw(makeSomePromise.then(...));
> > ```
> I find these kind of things confusing. RSVP did something similar,
> RSVP.rethrow = r => setImmediate(() => throw r);
> so that you write
> somePromise.then(...).catch(RSVP.rethrow); // actually RSVP uses `fail`.
> It's not clear to me why this, or your `Promise.throw`, is better than
> // or
As I said, I think we will eventually add something that provides this or
similar functionality. But it does not need to be added to the subset this
repository seeks to define -- for the immediate needs of DOM. Since the
topic of this thread is "final steps", I'm just trying to be clear in this
context that this .done-ish issue is after these "final steps".
This is the kind of issue that is best decided after more experience with
several of these debugging aids, in both browser and server. So we should
of course continue to discuss these options on es-discuss regarding ES7.
Also, we won't have Weak References until ES7, and that bears on this
discussion and expected experience. FWIW, so far, I still like .done better
than the suggested alternatives.
> es-discuss mailing list
> es-discuss at mozilla.org
Text by me above is hereby placed in the public domain
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss