-
Notifications
You must be signed in to change notification settings - Fork 686
Fix Promise thenable. #3799
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
Fix Promise thenable. #3799
Conversation
130af1d to
2036a63
Compare
A single promise can be resolved any number of times due to thenable functions, but each resolver pair can only be called once. JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg [email protected]
|
Thank you for the review. Patch is updated. |
rerobika
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| NULL); | ||
| value_p->value = already_resolved; | ||
|
|
||
| value_p = ecma_create_named_data_property (ecma_get_object_from_value (funcs->reject), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to have the same kind of test for "reject" handler like the "resolve" one has?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A test case just like the one added in this PR. But probably reject behaves a bit differently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I get it now. Reject cannot be "delayed", that is a special feature of "resolve". Probably it would be too easy to start an infinite reject loop :)
galpeter
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
A single promise can be resolved any number of times due to thenable functions, but each resolver pair can only be called once.