Skip to content

Add promise rejection tracker support #4012

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

Closed

Conversation

rerobika
Copy link
Member

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
@rerobika rerobika added api Related to the public API ES2015 Related to ES2015 features jerry-ext Related to the jerry-ext library labels Jul 17, 2020
@rerobika
Copy link
Member Author

Related feature request: #2931 .

@rerobika rerobika linked an issue Jul 17, 2020 that may be closed by this pull request
@dbatyai
Copy link
Member

dbatyai commented Jul 17, 2020

I feel like it would be better to handle this as a port function instead of a callback that can be set via the API.

TEST_ASSERT (jerry_get_error_type (last_rejected_reason) == JERRY_ERROR_TYPE);
jerry_release_value (last_rejected_promise);
jerry_release_value (last_rejected_reason);

Copy link
Contributor

Choose a reason for hiding this comment

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

There should be also a test where the "global" reject handler is not invoked as the reject was handled already.

@@ -30,8 +30,11 @@ static const jerry_char_t test_source[] = TEST_STRING_LITERAL (
);

static int count_in_assert = 0;
static int tracter_counter = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

What does "tracter" mean?


**Summary**

Register a promise rejection tracker callback for the engine.
Copy link
Contributor

Choose a reason for hiding this comment

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

We should provide more details here imho and also mention the HostPromiseRejectionTracker from the standard here.

@rerobika
Copy link
Member Author

The PR should be reworked as a port function, so closing the PR for now.

@rerobika rerobika closed this Aug 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Related to the public API ES2015 Related to ES2015 features jerry-ext Related to the jerry-ext library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Discussion: Report unhandled promise rejections
3 participants