Skip to content

Add JS_IsPromise function#807

Merged
bnoordhuis merged 1 commit intoquickjs-ng:masterfrom
ialex32x:add-JS_IsPromise-func
Jan 9, 2025
Merged

Add JS_IsPromise function#807
bnoordhuis merged 1 commit intoquickjs-ng:masterfrom
ialex32x:add-JS_IsPromise-func

Conversation

@ialex32x
Copy link
Copy Markdown
Contributor

@ialex32x ialex32x commented Jan 9, 2025

No description provided.

@saghul
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants