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

Issue 2219623002: [promise] Spec compliance fixes for async/await (Closed)

Created:
4 years, 4 months ago by Dan Ehrenberg
Modified:
4 years ago
Reviewers:
caitp
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] Async/await edge case spec compliance fix - Don't read .constructor when returning a Promise from an async function. Instead, call out to the internals of Promise.resolve directly. This is done by adding back in an "optimization" from an earlier form of the async/await code written by Caitlin Potter. - Async functions always return a new Promise with a distinct identity, even if they simply return another Promise. R=caitp@igalia.com BUG=v8:4483 Committed: https://crrev.com/7826bfa7893d3890122399088b927b08432e301c Cr-Commit-Position: refs/heads/master@{#38404}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Always return a new promise from an async function #

Patch Set 3 : Test for rejection #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+49 lines, -26 lines) Patch
M src/js/harmony-async-await.js View 1 2 chunks +3 lines, -10 lines 0 comments Download
M src/js/prologue.js View 1 2 2 chunks +1 line, -3 lines 0 comments Download
M src/js/promise.js View 1 2 chunks +15 lines, -6 lines 1 comment Download
A test/mjsunit/harmony/async-await-no-constructor.js View 1 2 1 chunk +27 lines, -0 lines 0 comments Download
A + test/mjsunit/harmony/async-await-resolve-new.js View 1 1 chunk +3 lines, -7 lines 0 comments Download

Messages

Total messages: 20 (12 generated)
Dan Ehrenberg
4 years, 4 months ago (2016-08-05 00:23:38 UTC) #4
caitp
Test looks good. I do think we should have a similar test for rejections, even ...
4 years, 4 months ago (2016-08-05 00:43:44 UTC) #7
Dan Ehrenberg
Added a similar test for rejections, and fixed a related bug that Sathya and I ...
4 years, 4 months ago (2016-08-05 01:22:36 UTC) #9
caitp
lgtm https://codereview.chromium.org/2219623002/diff/40001/src/js/promise.js File src/js/promise.js (right): https://codereview.chromium.org/2219623002/diff/40001/src/js/promise.js#newcode395 src/js/promise.js:395: function PromiseCastResolved(value) { nit: an alternative name for ...
4 years, 4 months ago (2016-08-06 00:55:50 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2219623002/40001
4 years, 4 months ago (2016-08-06 00:56:22 UTC) #16
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 4 months ago (2016-08-06 00:58:23 UTC) #17
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/7826bfa7893d3890122399088b927b08432e301c Cr-Commit-Position: refs/heads/master@{#38404}
4 years, 4 months ago (2016-08-06 01:01:00 UTC) #19
gsathya
4 years ago (2016-11-30 18:02:27 UTC) #20
Message was sent while issue was closed.
On 2016/08/06 01:01:00, commit-bot: I haz the power wrote:
> Patchset 3 (id:??) landed as
> https://crrev.com/7826bfa7893d3890122399088b927b08432e301c
> Cr-Commit-Position: refs/heads/master@{#38404}

The test/mjsunit/harmony/async-await-no-constructor.js isn't valid per spec,
because 'await resovled' causes a PromiseResolveThenableJob which calls
Promise.prototype.then which does a constructor lookup.

The test currently works because we skip the PromiseResovleThenableJob in cases
of builtin promises.

Powered by Google App Engine
This is Rietveld 408576698