Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normative: Promise.{all,allSettled,race} should check resolve is a function before opening their iterable #1912

Merged

Conversation

kmiller68
Copy link
Contributor

@kmiller68 kmiller68 commented Mar 22, 2020

This change makes promise.{all,allSettled,race} behave more like a canonical JS implementation. In particular, the resolve property is now checked to be callable before beginning iteration on the first argument.

Closes #1902.

@kmiller68 kmiller68 changed the title This change makes promise.{all,allSettled,race} behave more like a Promise.{all,allSettled,race} should check resolve is a function before opening their iteratable Mar 22, 2020
@bakkot bakkot added needs consensus This needs committee consensus before it can be eligible to be merged. needs test262 tests The proposal should specify how to test an implementation. Ideally via github.com/tc39/test262 normative change Affects behavior required to correctly evaluate some ECMAScript source text labels Mar 22, 2020
spec.html Outdated Show resolved Hide resolved
spec.html Outdated Show resolved Hide resolved
spec.html Outdated Show resolved Hide resolved
spec.html Outdated Show resolved Hide resolved
spec.html Outdated Show resolved Hide resolved
spec.html Show resolved Hide resolved
@ljharb ljharb requested review from michaelficarra, syg and a team March 23, 2020 18:28
ljharb pushed a commit to tc39/agendas that referenced this pull request Apr 1, 2020
@ljharb ljharb added has consensus This has committee consensus. and removed needs consensus This needs committee consensus before it can be eligible to be merged. labels Jun 1, 2020
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Jun 3, 2020
xeonchen pushed a commit to xeonchen/gecko that referenced this pull request Jun 4, 2020
mathiasbynens pushed a commit to tc39/proposal-promise-any that referenced this pull request Jun 4, 2020
@kmiller68 kmiller68 force-pushed the promise-functions-iteration-consistency branch from 54602e3 to abc3c32 Compare June 4, 2020 23:10
@kmiller68
Copy link
Contributor Author

Looks, like @shvaikalesh graciously updated test262 for me with tc39/test262#2648. (Thanks!)

I rebased against the current spec and fixed my summaries to match the newer style. I noticed that we use the phrasing The abstract operation <Op> takes argument <Arg>., which seems odd to me but I kept it for consistency.

spec.html Outdated Show resolved Hide resolved
@kmiller68 kmiller68 added has test262 tests and removed needs test262 tests The proposal should specify how to test an implementation. Ideally via github.com/tc39/test262 labels Jun 6, 2020
Copy link
Contributor

@syg syg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ljharb ljharb requested review from bakkot and a team June 8, 2020 23:54
@ljharb ljharb self-assigned this Jun 8, 2020
backwardn pushed a commit to backwardn/v8 that referenced this pull request Jun 9, 2020
Promise.{all,allSettled,any,race} should check resolve is a function before
opening their iteratable.

PR: tc39/ecma262#1912

PR for Promise.any: tc39/proposal-promise-any#65

This CL includes the following cleanup changes:
- Made it more explicit that the constructor is a Constructor.
- Removed unnecessary nested try blocks (a try can have both a catch and a label).
- Moved commonly used definitions out of promise-race.tq where they don't belong.
- Made the parameter order of PerformPromiseAll match the spec.


Bug: v8:10578
Change-Id: I9deb5d5106db7350a0d0ad52f165ff2469e7074b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2232544
Commit-Queue: Marja Hölttä <[email protected]>
Reviewed-by: Igor Sheludko <[email protected]>
Reviewed-by: Shu-yu Guo <[email protected]>
Cr-Commit-Position: refs/heads/master@{#68260}
spec.html Show resolved Hide resolved
@ljharb ljharb changed the title Promise.{all,allSettled,race} should check resolve is a function before opening their iteratable Normative: Promise.{all,allSettled,race} should check resolve is a function before opening their iterable Jun 10, 2020
ljharb pushed a commit to kmiller68/ecma262 that referenced this pull request Jun 10, 2020
…nction before opening their iterable (tc39#1912)

This change makes promise.{all,allSettled,race} behave more like a
canonical JS implementation.  In particular, the resolve property is
now checked to be callable before beginning iteration on the first
argument.

Closes tc39#1902.
@ljharb ljharb force-pushed the promise-functions-iteration-consistency branch from dc589fa to 6ca6f94 Compare June 10, 2020 05:21
…nction before opening their iterable (tc39#1912)

This change makes promise.{all,allSettled,race} behave more like a
canonical JS implementation.  In particular, the resolve property is
now checked to be callable before beginning iteration on the first
argument.

Closes tc39#1902.
@ljharb ljharb force-pushed the promise-functions-iteration-consistency branch from 6ca6f94 to 855093b Compare June 10, 2020 05:22
@ljharb ljharb merged commit 855093b into tc39:master Jun 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has consensus This has committee consensus. has test262 tests normative change Affects behavior required to correctly evaluate some ECMAScript source text
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Promise.{all,allSettled,race} should check resolve is a function before opening their iteratable
4 participants