We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
BigInt
If you format a negative BigInt instance, the sign (-) gets printed twice.
-
let int = BigInt::from(-1);
console_log!
console_log!("{}", int); // --1
Minimal test repo: https://github.com/ryangoree/js-sys-bigint-display-bug
The sign would be printed once (-1).
-1
The sign is printed twice (--1).
--1
The text was updated successfully, but these errors were encountered:
Looks like the problem is here:
wasm-bindgen/crates/js-sys/src/lib.rs
Line 1496 in ddceac7
The docs for pad_integral state:
pad_integral
The str should not contain the sign for the integer, that will be added by this method.
However to_string_unchecked calls toString on the bigint which returns a string with the sign:
to_string_unchecked
toString
Lines 1349 to 1350 in ddceac7
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Describe the Bug
If you format a negative
BigInt
instance, the sign (-
) gets printed twice.Steps to Reproduce
BigInt
console_log!
macro to see it's formatted with 2 signs:Minimal test repo: https://github.com/ryangoree/js-sys-bigint-display-bug
Expected Behavior
The sign would be printed once (
-1
).Actual Behavior
The sign is printed twice (
--1
).The text was updated successfully, but these errors were encountered: