https://codereview.chromium.org/600723005/diff/1/src/promise.js
File src/promise.js (right):

https://codereview.chromium.org/600723005/diff/1/src/promise.js#newcode212
src/promise.js:212: SET_PRIVATE(promise, promiseHasHandler, true);
On 2014/09/30 10:30:42, domenic wrote:
This doesn't seem correct. The promise doesn't have any handlers yet,
and it
*should* trigger an is-rejected callback. (It may trigger a
rejection-revoked
callback later within the same turn, but if someone does `var p =
Promise.reject(new Error("boo!"))` and never handles that, we need to
notify of
that.)

If I reject a promise by returning a rejected promise like this:

var p = new Promise(function() { return Promise.reject('foo'); });

I would get two rejected promises, which is kind of weird imo. I would
argue that someone who uses Promise.reject to create a promise expects
this and would not be caught by surprise if the promise he gets is
indeed rejected.

In my example, while p may be handled later on, the promise that is
returned is never handled because it is used merely to signal a reject.
Not handling it is completely intentional.

I do agree though that this special case is less than ideal.

https://codereview.chromium.org/600723005/

--
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to