Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Issue 99573002: Promises: some adaptations to spec (Closed)

Created:
7 years ago by rossberg
Modified:
6 years, 11 months ago
CC:
v8-dev
Visibility:
Public.

Description

Promises: some adaptations to spec - Rename Promise.{resolved,rejected,deferred} to Promise.{resolve,reject,defer} - Rename Promise.one to Promise.race - Make all failures asynchronous, EXCEPT type errors for resolver - Disallow non-construct call to Promise constructor - Don't make combinators go through public this.defer Also, don't bother using IsCallable. R=dslomov@chromium.org, yhirano@chromium.org BUG= Committed: https://code.google.com/p/v8/source/detail?r=18515

Patch Set 1 #

Total comments: 10

Patch Set 2 : Dmitry's comments #

Total comments: 6

Patch Set 3 : Rename 'one' #

Patch Set 4 : Throw on non-function resolver #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+265 lines, -226 lines) Patch
M src/messages.js View 1 2 3 1 chunk +3 lines, -2 lines 0 comments Download
M src/promise.js View 1 2 3 5 chunks +61 lines, -51 lines 7 comments Download
M src/runtime.h View 1 chunk +0 lines, -1 line 0 comments Download
M src/runtime.cc View 1 chunk +0 lines, -8 lines 0 comments Download
M test/mjsunit/harmony/promises.js View 1 2 3 51 chunks +201 lines, -164 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
rossberg
7 years ago (2013-12-02 17:35:17 UTC) #1
Dmitry Lomov (no reviews)
Mostly stylistic comments + objection to shipping deref/relying on defer in tests that might be ...
7 years ago (2013-12-04 09:24:42 UTC) #2
rossberg
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 ...
7 years ago (2013-12-06 11:43:29 UTC) #3
Dmitry Lomov (no reviews)
lgtm
7 years ago (2013-12-06 11:49:10 UTC) #4
yhirano
https://codereview.chromium.org/99573002/diff/20001/src/promise.js File src/promise.js (right): https://codereview.chromium.org/99573002/diff/20001/src/promise.js#newcode63 src/promise.js:63: function Promise(resolver) { I'm still not sure. The spec ...
7 years ago (2013-12-09 02:31:35 UTC) #5
rossberg
https://codereview.chromium.org/99573002/diff/20001/src/promise.js File src/promise.js (right): https://codereview.chromium.org/99573002/diff/20001/src/promise.js#newcode63 src/promise.js:63: function Promise(resolver) { On 2013/12/09 02:31:36, yhirano wrote: > ...
7 years ago (2013-12-10 10:11:14 UTC) #6
arv (Not doing code reviews)
I didn't see any discussion regarding the race/one function name. https://codereview.chromium.org/99573002/diff/20001/src/promise.js File src/promise.js (right): https://codereview.chromium.org/99573002/diff/20001/src/promise.js#newcode303 ...
7 years ago (2013-12-10 14:21:24 UTC) #7
yhirano
https://codereview.chromium.org/99573002/diff/20001/src/promise.js File src/promise.js (right): https://codereview.chromium.org/99573002/diff/20001/src/promise.js#newcode63 src/promise.js:63: function Promise(resolver) { On 2013/12/10 10:11:15, rossberg wrote: > ...
7 years ago (2013-12-11 04:46:31 UTC) #8
rossberg
https://codereview.chromium.org/99573002/diff/20001/src/promise.js File src/promise.js (right): https://codereview.chromium.org/99573002/diff/20001/src/promise.js#newcode63 src/promise.js:63: function Promise(resolver) { On 2013/12/11 04:46:31, yhirano wrote: > ...
6 years, 11 months ago (2014-01-09 12:51:43 UTC) #9
rossberg
Committed patchset #4 manually as r18515 (presubmit successful).
6 years, 11 months ago (2014-01-09 13:01:07 UTC) #10
arv (Not doing code reviews)
https://codereview.chromium.org/99573002/diff/90001/src/promise.js File src/promise.js (right): https://codereview.chromium.org/99573002/diff/90001/src/promise.js#newcode65 src/promise.js:65: if (!%_IsConstructCall()) throw MakeTypeError('not_a_promise', [this]); Doesn't this break sub ...
6 years, 11 months ago (2014-01-09 15:47:15 UTC) #11
rossberg
https://codereview.chromium.org/99573002/diff/90001/src/promise.js File src/promise.js (right): https://codereview.chromium.org/99573002/diff/90001/src/promise.js#newcode65 src/promise.js:65: if (!%_IsConstructCall()) throw MakeTypeError('not_a_promise', [this]); On 2014/01/09 15:47:15, arv ...
6 years, 11 months ago (2014-01-09 16:09:56 UTC) #12
arv (Not doing code reviews)
6 years, 11 months ago (2014-01-09 19:13:27 UTC) #13
Message was sent while issue was closed.
https://codereview.chromium.org/99573002/diff/90001/src/promise.js
File src/promise.js (right):

https://codereview.chromium.org/99573002/diff/90001/src/promise.js#newcode65
src/promise.js:65: if (!%_IsConstructCall()) throw
MakeTypeError('not_a_promise', [this]);
On 2014/01/09 16:09:56, rossberg wrote:
> On 2014/01/09 15:47:15, arv wrote:
> > Doesn't this break sub classing?
> > 
> > function SubPromise(resolver) {
> >   Promise.call(this, resolver);
> > }
> > SubPromise.prototype = {
> >   __proto__: Promise.prototype,
> >   constructor: SubPromise
> > };
> 
> I agree, but it's what the spec says.

I think this is the right call for now. Once we support @@create we should be
able to fix this part to check the internal slots as required by the spec.

Powered by Google App Engine
This is Rietveld 408576698