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

Add tests for Promise.all|race resolve lookup #2131

Merged
merged 3 commits into from
Apr 25, 2019

Conversation

leobalter
Copy link
Member

Ref tc39/ecma262#1506

The proposed spec needs consensus, please don't merge this yet.

@gsathya
Copy link
Member

gsathya commented Apr 19, 2019

Thanks, I ran these against V8's implementation and they all pass!

But, the following test262 tests need updating as well:

  'built-ins/Promise/all/capability-executor-called-twice': [FAIL],
  'built-ins/Promise/all/capability-resolve-throws-no-close': [FAIL],
  'built-ins/Promise/all/capability-resolve-throws-reject': [FAIL],
  'built-ins/Promise/all/invoke-resolve-get-error-close': [FAIL],
  'built-ins/Promise/all/species-get-error': [FAIL],
  'built-ins/Promise/race/capability-executor-called-twice': [FAIL],
  'built-ins/Promise/race/invoke-resolve-get-error-close': [FAIL],
  'built-ins/Promise/race/species-get-error': [FAIL],

@leobalter
Copy link
Member Author

Thanks! I'll take a look at these and any potentially matching for allSettled

@leobalter leobalter self-assigned this Apr 22, 2019
@gsathya
Copy link
Member

gsathya commented Apr 23, 2019

Thanks! I'll take a look at these and any potentially matching for allSettled

These are the failing allSettled ones --

  'built-ins/Promise/allSettled/capability-executor-called-twice': [FAIL],                                                                                    
  'built-ins/Promise/allSettled/capability-resolve-throws-no-close': [FAIL],                                                                                  
  'built-ins/Promise/allSettled/capability-resolve-throws-reject': [FAIL],
  'built-ins/Promise/allSettled/invoke-resolve-get-error-close': [FAIL],
  'built-ins/Promise/allSettled/species-get-error': [FAIL],                                                                                                   

@leobalter leobalter force-pushed the resolve-lookup branch 2 times, most recently from 2a0d69f to 2076005 Compare April 24, 2019 18:23
@leobalter
Copy link
Member Author

tests are up, thanks for reporting the errors! I also caught some new false positives that are not prevented in the modified tests.

@leobalter
Copy link
Member Author

CircleCI is giving a false positive for the tests execution due to an upgrade on Test262's version that requires another upgrade on Test262-harness that is planned to be updated soon.

@leobalter
Copy link
Member Author

@gsathya would you take a look, please? I can tell from local runs the only tests I'm getting errors are the ones related to the function name.

@gsathya
Copy link
Member

gsathya commented Apr 24, 2019

All tests pass on ToT v8 🔥

@leobalter leobalter merged commit 1e4c5ae into tc39:master Apr 25, 2019
oleavr pushed a commit to frida/v8 that referenced this pull request Apr 26, 2019
In the PerformPromise{All, Race, AllSettled} operations, the resolve
property of the constructor is looked up only once.

In the implementation, for the fast path, where the constructor's
resolve property is untainted, the resolve function is set to undefined.
Since undefined can't be a valid value for the resolve function,
we can switch on it (in CallResolve) to directly call the  PromiseResolve
builtin. If the resolve property is tainted, we do an observable property
lookup, save this value, and call this property later (in CallResolve).

I ran this CL against the test262 tests locally and they all pass:
tc39/test262#2131

Spec:
- tc39/ecma262#1506
- tc39/proposal-promise-allSettled#40

Bug: v8:9152
Change-Id: Icb36a90b5a244a67a729611c7b3315d2c29de6e9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1574705
Commit-Queue: Sathya Gunasekaran <[email protected]>
Reviewed-by: Jakob Gruber <[email protected]>
Cr-Commit-Position: refs/heads/master@{#60957}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants