Skip to content

Add JS_IsPromise function #807

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 1 commit into from
Jan 9, 2025

Conversation

ialex32x
Copy link
Contributor

@ialex32x ialex32x commented Jan 9, 2025

No description provided.

@saghul
Copy link
Contributor

saghul commented Jan 9, 2025

Technically JS_PromiseState() == -1 accomplishes the same. Now an argument can be made about symmetry, so sure why not?

@ialex32x
Copy link
Contributor Author

ialex32x commented Jan 9, 2025

Oh, I didn't realize JS_PromiseState can accomplish the same. Both are acceptable to me.

Copy link
Contributor

@bnoordhuis bnoordhuis left a comment

Choose a reason for hiding this comment

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

JS_IsPromise is more obvious than checking JS_PromiseState's return value for error so LGTM.

@bnoordhuis bnoordhuis merged commit f22dee0 into quickjs-ng:master Jan 9, 2025
59 checks passed
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