Fix BigInt issue with zero value
Looks like 0 is a special case: 4318b2348d/deps/v8/src/objects/bigint.cc (L1595-L1602)
This commit is contained in:
parent
ac25965ad3
commit
d3e37a44cb
6 changed files with 15 additions and 0 deletions
crates/napi/src/bindgen_runtime/js_values
|
@ -64,6 +64,9 @@ impl FromNapiValue for BigInt {
|
|||
|
||||
words.set_len(word_count as usize);
|
||||
}
|
||||
if word_count == 0 {
|
||||
words = vec![0];
|
||||
}
|
||||
Ok(BigInt {
|
||||
sign_bit: sign_bit == 1,
|
||||
words,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue