Skip to content

Introduce jerry_port_track_promise_rejection #4451

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

Conversation

rerobika
Copy link
Member

This patch resolves #2931.

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

@rerobika rerobika added the jerry-port Related to the port API or the default port implementation label Jan 11, 2021
@rerobika rerobika force-pushed the port_promise_rejection_tracker branch from 94cdf15 to 59483cd Compare January 11, 2021 17:10
@rerobika rerobika force-pushed the port_promise_rejection_tracker branch from 59483cd to a39ad7b Compare January 12, 2021 09:44
Copy link
Member

@akosthekiss akosthekiss left a comment

Choose a reason for hiding this comment

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

The commit message got mixed up a bit during the update, please fix (superfluous "report" remained.) Plus, the PR title could also be updated.

@rerobika rerobika changed the title Introduce jerry_port_report_unhandled_promise_rejection Introduce jerry_port_track_promise_rejection Jan 12, 2021
@rerobika rerobika force-pushed the port_promise_rejection_tracker branch 2 times, most recently from d8f0141 to 7a265f4 Compare January 12, 2021 12:11
@rerobika rerobika requested a review from akosthekiss January 12, 2021 15:06
* @param promise rejected promise
* @param operation HostPromiseRejectionTracker operation
*/
void jerry_port_track_promise_rejection (const jerry_value_t promise,
Copy link
Member

Choose a reason for hiding this comment

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

I was also considering suggesting yet another name change, to have the new function named jerry_port_promise_rejection_tracker. That would make the new typedef and the new function names aligned, as well as the name used by the spec. However, existing port API function names usually start with a verb (get this, set that, sleep, print, log, etc. -- the only exception being fatal). So, I'm not sure about this. But we should agree upon a good name so that it doesn't need to be changed, at least in the near future.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd keep this jerry_port_track_promise_rejection for the due to the starting verb convention with the other API functions.

jerry_port_promise_rejection_tracker would be suitable if we would rename jerry_port_log to jerry_port_logger and so on. So I'd leave as it for now.

@rerobika rerobika force-pushed the port_promise_rejection_tracker branch from 7a265f4 to b39ac3d Compare January 15, 2021 12:52
@rerobika
Copy link
Member Author

@akosthekiss Thanks for the review, I've updated the PR.

This patch resolves jerryscript-project#2931.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
@rerobika rerobika force-pushed the port_promise_rejection_tracker branch from b39ac3d to 7bce57c Compare January 15, 2021 12:57
Copy link
Member

@akosthekiss akosthekiss left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@dbatyai dbatyai left a comment

Choose a reason for hiding this comment

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

LGTM

@dbatyai dbatyai merged commit c4676a2 into jerryscript-project:master Jan 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jerry-port Related to the port API or the default port implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Discussion: Report unhandled promise rejections
3 participants