Skip to content

Conversation

@zherczeg
Copy link
Member

A single promise can be resolved any number of times due to thenable functions, but each resolver pair can only be called once.

@zherczeg zherczeg force-pushed the promise_fix branch 3 times, most recently from 130af1d to 2036a63 Compare May 26, 2020 12:46
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]
@zherczeg
Copy link
Member Author

Thank you for the review. Patch is updated.

Copy link
Member

@rerobika rerobika left a 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),
Copy link
Contributor

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

What do you mean?

Copy link
Contributor

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.

Copy link
Member Author

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 :)

Copy link
Contributor

@galpeter galpeter left a comment

Choose a reason for hiding this comment

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

lgtm

@zherczeg zherczeg merged commit 562dcc8 into jerryscript-project:master May 28, 2020
@zherczeg zherczeg deleted the promise_fix branch May 28, 2020 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants