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

Issue 194663003: API support for promises (Closed)

Created:
6 years, 9 months ago by rossberg
Modified:
6 years, 9 months ago
Reviewers:
Sven Panne, yhirano
CC:
v8-dev, Paweł Hajdan Jr.
Visibility:
Public.

Description

Patch Set 1 #

Total comments: 6

Patch Set 2 : Sven's comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+355 lines, -54 lines) Patch
M include/v8.h View 1 3 chunks +49 lines, -0 lines 0 comments Download
M src/api.cc View 1 2 chunks +125 lines, -0 lines 0 comments Download
M src/bootstrapper.cc View 1 chunk +9 lines, -0 lines 0 comments Download
M src/contexts.h View 2 chunks +12 lines, -0 lines 0 comments Download
M src/promise.js View 1 chunk +9 lines, -0 lines 0 comments Download
M src/runtime.h View 1 chunk +1 line, -1 line 0 comments Download
M test/cctest/test-api.cc View 1 chunk +94 lines, -0 lines 0 comments Download
M tools/v8heapconst.py View 1 2 chunks +56 lines, -53 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
rossberg
PTAL
6 years, 9 months ago (2014-03-11 10:56:08 UTC) #1
Sven Panne
LGTM with nits https://codereview.chromium.org/194663003/diff/1/include/v8.h File include/v8.h (right): https://codereview.chromium.org/194663003/diff/1/include/v8.h#newcode1417 include/v8.h:1417: * This is an experimental feature. ...
6 years, 9 months ago (2014-03-11 11:44:05 UTC) #2
yhirano
https://codereview.chromium.org/194663003/diff/1/include/v8.h File include/v8.h (right): https://codereview.chromium.org/194663003/diff/1/include/v8.h#newcode2562 include/v8.h:2562: Can we have Then, too?
6 years, 9 months ago (2014-03-11 11:46:42 UTC) #3
rossberg
https://codereview.chromium.org/194663003/diff/1/include/v8.h File include/v8.h (right): https://codereview.chromium.org/194663003/diff/1/include/v8.h#newcode1417 include/v8.h:1417: * This is an experimental feature. Only works with ...
6 years, 9 months ago (2014-03-11 16:08:40 UTC) #4
rossberg
Committed patchset #2 manually as r19811 (presubmit successful).
6 years, 9 months ago (2014-03-11 16:17:28 UTC) #5
yhirano
We have WebCore::ScriptPromise::then. Though it is possible to implement it with general property access, v8::Promise::Then ...
6 years, 9 months ago (2014-03-12 01:23:15 UTC) #6
yhirano
> Though it is possible to implement it with general property access, I was wrong. ...
6 years, 9 months ago (2014-03-14 05:57:00 UTC) #7
rossberg
On 2014/03/12 01:23:15, yhirano wrote: > We have WebCore::ScriptPromise::then. > Though it is possible to ...
6 years, 9 months ago (2014-03-14 07:14:32 UTC) #8
yhirano
6 years, 9 months ago (2014-03-14 14:17:42 UTC) #9
Message was sent while issue was closed.
On 2014/03/14 07:14:32, rossberg wrote:
> On 2014/03/12 01:23:15, yhirano wrote:
> > We have WebCore::ScriptPromise::then.
> > Though it is possible to implement it with general property access,
> > v8::Promise::Then is useful.
> > 
> >
>
https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit...
> 
> Interesting. But why does this need Then instead of plain chaining? This is an
> honest question. For example, I don't understand why you would need thenable
> assimilation on the API side.

ScriptPromise::then will be used by Blink developers to attach handlers to a
Promise provided by a JavaScript developer.
If we don't have |then|, we have to specify to pass a Promise that wraps an
object exactly once to DOM methods, i.e. a JavaScript developer should know if
it is a Promise of an object or a Promise of a Promise of an object. It is
nonsense I think. We need recursive unwrapping.

Powered by Google App Engine
This is Rietveld 408576698