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

https://codereview.chromium.org/99573002/diff/1/src/promise.js#newcode230
src/promise.js:230: typeof (then = x.then) === 'function') {
On 2013/12/04 09:24:43, Dmitry Lomov (chromium) wrote:
Can we not have assignments in conditions? Pretty please? Replace with
   if (IS_NULL_OR_UNDEFINED(x)) return x;
   var then = x.then;
   if (typeof(then) !== 'function') return x;

Done.

https://codereview.chromium.org/99573002/diff/1/src/promise.js#newcode257
src/promise.js:257: var deferred = %_CallFunction(this,
PromiseDeferred);
On 2013/12/04 09:24:43, Dmitry Lomov (chromium) wrote:
Instead of using %_CallFunction here and above, let's have utility
method
PromiseDeferredImpl, replace these calls with
PromiseDeferredImpl(this), and
    Promise.defer = function(this) { PromiseDeferredImpl(this); }
Even better, I suggest not shipping defer (see below) :)

Why? Avoiding extra hoops like that is exactly why we have
%_CallFunction (which really just is a safe and efficient version of
f.call).

https://codereview.chromium.org/99573002/diff/1/src/promise.js#newcode270
src/promise.js:270: function(r) { deferred.reject(r) }
On 2013/12/04 09:24:43, Dmitry Lomov (chromium) wrote:
Why 'count > 0' condition disappeared here? What if more than one of
values
fail?

Reject used to throw on non-pending promises in an earlier version. For
legacy compatibility, I already changed that to just ignore the attempt,
so the extra check here became redundant (as in PromiseOne below).

https://codereview.chromium.org/99573002/diff/1/src/promise.js#newcode301
src/promise.js:301: "defer", PromiseDeferred,
On 2013/12/04 09:24:43, Dmitry Lomov (chromium) wrote:
So, my understanding is that 'defer' is non-standard as of now? Let's
not ship
non-standard API maybe? (maybe a separate CL)

As per off-line discussion, I leave it in for the time being.

https://codereview.chromium.org/99573002/

--
--
v8-dev mailing list
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to