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

Issue 1534813005: [promise] Make Promise.all match spec, and always respect [[AlreadyResolved]] (Closed)

Created:
5 years ago by caitp (gmail)
Modified:
4 years, 11 months ago
CC:
v8-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[promise] Make Promise.all match spec, and always respect [[AlreadyResolved]] Testing the promise status is not enough to ensure that resolve functions are called only once. This change adds a similar version of the [[AlreadyResolved]] slot to the Promise.all resolve element function, and also ensures that [[AlreadyResolved]] is respected in the Promise executor, and when resolving thenables. This means replacing PromiseReject() shortcuts with promiseCapability.reject(), which has an [[AlreadyResolved]] record in a context slot. Also ensures that changes to the list accumulator in Promise.all() is not observable via accessors installed in the Array prototype chain, using the same mechanism used in several Array methods. Fixes the following Test262 tests: - built-ins/Promise/all/call-resolve-element-items.js - built-ins/Promise/all/call-resolve-element.js - built-ins/Promise/all/call-resolve-element-after-return.js - built-ins/Promise/all/same-reject-function.js - built-ins/Promise/all/resolve-from-same-thenable.js - built-ins/Promise/all/resolve-before-loop-exit.js - built-ins/Promise/all/resolve-before-loop-exit-from-same.js - built-ins/Promise/exception-after-resolve-in-executor.js - built-ins/Promise/exception-after-resolve-in-thenable-job.js - built-ins/Promise/all/does-not-invoke-array-setters.js BUG=v8:4633 LOG=N R=littledan@chromium.org, cbruni@chromium.org Committed: https://crrev.com/7459d8cecb2dbfc219c7a5eb528f907a17f9e34c Cr-Commit-Position: refs/heads/master@{#33163}

Patch Set 1 : #

Total comments: 2

Patch Set 2 : Address comments + make Promise/all/does-not-invoke-array-setters pass #

Total comments: 3

Patch Set 3 : base on top of recent merge #

Patch Set 4 : Rebase #

Patch Set 5 : Rebase again #

Total comments: 7

Patch Set 6 : Remove "append NULL" since it doesn't seem to be needed, rearrange code #

Unified diffs Side-by-side diffs Delta from patch set Stats (+38 lines, -31 lines) Patch
M src/js/promise.js View 1 2 3 4 5 3 chunks +38 lines, -21 lines 0 comments Download
M test/test262/test262.status View 1 2 3 4 1 chunk +0 lines, -10 lines 0 comments Download

Messages

Total messages: 40 (16 generated)
caitp (gmail)
another promise compliance fix
5 years ago (2015-12-18 17:05:38 UTC) #1
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1534813005/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1534813005/20001
4 years, 11 months ago (2016-01-04 02:47:33 UTC) #4
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: v8_android_arm_compile_rel on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_android_arm_compile_rel/builds/11641) v8_linux64_avx2_rel on ...
4 years, 11 months ago (2016-01-04 02:48:28 UTC) #6
caitp (gmail)
On 2016/01/04 02:48:28, commit-bot: I haz the power wrote: > Dry run: Try jobs failed ...
4 years, 11 months ago (2016-01-04 02:49:06 UTC) #7
Dan Ehrenberg
One comment; haven't yet verified that this matches the spec but looks good at a ...
4 years, 11 months ago (2016-01-04 02:49:15 UTC) #8
caitp (gmail)
On 2016/01/04 02:49:15, Dan Ehrenberg wrote: > One comment; haven't yet verified that this matches ...
4 years, 11 months ago (2016-01-04 14:05:09 UTC) #11
Dan Ehrenberg
https://codereview.chromium.org/1534813005/diff/40001/src/js/promise.js File src/js/promise.js (right): https://codereview.chromium.org/1534813005/diff/40001/src/js/promise.js#newcode362 src/js/promise.js:362: function CreateResolveElementFunction(index, values, promiseCapability) { Does this need to ...
4 years, 11 months ago (2016-01-04 18:18:39 UTC) #13
caitp (gmail)
https://codereview.chromium.org/1534813005/diff/40001/src/js/promise.js File src/js/promise.js (right): https://codereview.chromium.org/1534813005/diff/40001/src/js/promise.js#newcode362 src/js/promise.js:362: function CreateResolveElementFunction(index, values, promiseCapability) { On 2016/01/04 18:18:39, Dan ...
4 years, 11 months ago (2016-01-04 18:20:08 UTC) #14
caitp (gmail)
https://codereview.chromium.org/1534813005/diff/40001/src/js/promise.js File src/js/promise.js (right): https://codereview.chromium.org/1534813005/diff/40001/src/js/promise.js#newcode362 src/js/promise.js:362: function CreateResolveElementFunction(index, values, promiseCapability) { On 2016/01/04 18:20:08, caitp ...
4 years, 11 months ago (2016-01-04 19:26:52 UTC) #15
caitp (gmail)
On 2016/01/04 19:26:52, caitp wrote: > https://codereview.chromium.org/1534813005/diff/40001/src/js/promise.js > File src/js/promise.js (right): > > https://codereview.chromium.org/1534813005/diff/40001/src/js/promise.js#newcode362 > ...
4 years, 11 months ago (2016-01-04 20:51:49 UTC) #16
Dan Ehrenberg
lgtm Yes, once you need to box something, it seems fine like this. One thing ...
4 years, 11 months ago (2016-01-04 21:01:03 UTC) #17
caitp (gmail)
On 2016/01/04 21:01:03, Dan Ehrenberg wrote: > lgtm > > Yes, once you need to ...
4 years, 11 months ago (2016-01-05 14:24:49 UTC) #19
Dan Ehrenberg
On 2016/01/05 at 14:24:49, caitpotter88 wrote: > On 2016/01/04 21:01:03, Dan Ehrenberg wrote: > > ...
4 years, 11 months ago (2016-01-05 16:43:00 UTC) #22
Dan Ehrenberg
lgtm
4 years, 11 months ago (2016-01-06 17:20:56 UTC) #24
caitp (gmail)
On 2016/01/06 17:20:56, Dan Ehrenberg wrote: > lgtm +adamk for src/js/OWNERS
4 years, 11 months ago (2016-01-07 16:01:22 UTC) #26
adamk
https://codereview.chromium.org/1534813005/diff/160001/src/js/promise.js File src/js/promise.js (right): https://codereview.chromium.org/1534813005/diff/160001/src/js/promise.js#newcode351 src/js/promise.js:351: resolutions[i] = UNDEFINED; Why is this needed? https://codereview.chromium.org/1534813005/diff/160001/src/js/promise.js#newcode373 src/js/promise.js:373: ...
4 years, 11 months ago (2016-01-07 19:12:10 UTC) #28
caitp (gmail)
https://codereview.chromium.org/1534813005/diff/160001/src/js/promise.js File src/js/promise.js (right): https://codereview.chromium.org/1534813005/diff/160001/src/js/promise.js#newcode351 src/js/promise.js:351: resolutions[i] = UNDEFINED; On 2016/01/07 19:12:10, adamk wrote: > ...
4 years, 11 months ago (2016-01-07 19:20:36 UTC) #29
adamk
https://codereview.chromium.org/1534813005/diff/160001/src/js/promise.js File src/js/promise.js (right): https://codereview.chromium.org/1534813005/diff/160001/src/js/promise.js#newcode351 src/js/promise.js:351: resolutions[i] = UNDEFINED; On 2016/01/07 19:20:35, caitp wrote: > ...
4 years, 11 months ago (2016-01-07 19:29:30 UTC) #30
caitp (gmail)
https://codereview.chromium.org/1534813005/diff/160001/src/js/promise.js File src/js/promise.js (right): https://codereview.chromium.org/1534813005/diff/160001/src/js/promise.js#newcode351 src/js/promise.js:351: resolutions[i] = UNDEFINED; On 2016/01/07 19:29:30, adamk wrote: > ...
4 years, 11 months ago (2016-01-07 19:37:59 UTC) #31
caitp (gmail)
4 years, 11 months ago (2016-01-07 19:38:04 UTC) #32
adamk
lgtm
4 years, 11 months ago (2016-01-07 19:47:23 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1534813005/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1534813005/180001
4 years, 11 months ago (2016-01-07 19:54:00 UTC) #36
commit-bot: I haz the power
Committed patchset #6 (id:180001)
4 years, 11 months ago (2016-01-07 20:23:51 UTC) #38
commit-bot: I haz the power
4 years, 11 months ago (2016-01-07 20:24:36 UTC) #40
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/7459d8cecb2dbfc219c7a5eb528f907a17f9e34c
Cr-Commit-Position: refs/heads/master@{#33163}

Powered by Google App Engine
This is Rietveld 408576698