Skip to content

js-sys: Fix BigInt::from(usize) and BigInt::from(isize) #3056

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 3 commits into from
Sep 2, 2022

Conversation

Liamolucko
Copy link
Collaborator

Fixes #3055

This changes isize and usize to be converted to BigInt in the same way as i32/u32, BigInt(JsValue::from(n)), rather than JsValue::from(n).unchecked_into(). The latter is now wrong because as of #2978 that JsValue::from returns a Number, not a BigInt.

Fixes rustwasm#3055

This changes `isize` and `usize` to be converted to `BigInt` in the same way as `i32`/`u32`, `BigInt(JsValue::from(n))`, rather than `JsValue::from(n).unchecked_into()`. The latter is now wrong since as of rustwasm#2978 that `JsValue::from` returns a `Number`, not a `BigInt`.
@alexcrichton alexcrichton merged commit f75a3f8 into rustwasm:main Sep 2, 2022
@Liamolucko Liamolucko deleted the fix-bigint-from-usize branch September 2, 2022 21:19
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.

BigInt::from(usize) and BigInt::from(isize) are broken
3 participants