Skip to content

refactor(shared): respect Promise A+ specification #8506

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

Merged
merged 2 commits into from
Jul 11, 2023

Conversation

Alfred-Skyblue
Copy link
Member

In the Promise A+ specification, Promise is an object or function that has a then method, and we should add function checks for it.

Copy link
Member

@sxzz sxzz left a comment

Choose a reason for hiding this comment

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

LGTM

@Alfred-Skyblue
Copy link
Member Author

The Promise A+ specification does not describe that a PromiseLike must necessarily have a catch method. In fact, the catch method is part of the ECMAScript 2015 specification. Should we consider removing the detection of the catch method?

@sxzz
Copy link
Member

sxzz commented Jun 6, 2023

@Alfred-Skyblue

We need to call catch method to handle errors.

awaitable = awaitable.catch(e => {

@Alfred-Skyblue
Copy link
Member Author

@Alfred-Skyblue

We need to call catch method to handle errors.

awaitable = awaitable.catch(e => {

Ok, thank you for your answer.

@sxzz sxzz added the ready to merge The PR is ready to be merged. label Jun 10, 2023
@sxzz sxzz changed the title chore: synchronize Promise A+ specification refactor(shared): respect Promise A+ specification Jun 10, 2023
@yyx990803 yyx990803 merged commit 97b6fae into vuejs:main Jul 11, 2023
@Alfred-Skyblue Alfred-Skyblue deleted the update-shared branch July 11, 2023 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge The PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants