Browse Source

Implement i128/u128 to JsBigInt conversions (#3129)

* Implement i128/u128 to JsValue Conversions
This commit implements trait conversions to JsValue for i128/u128.
This addresses #1970

* Remove Numeric trait impl for u/i128

* Re-add JsBigInt conversion for u/i128

* Update boa_engine/src/bigint.rs

Co-authored-by: Haled Odat <8566042+HalidOdat@users.noreply.github.com>

* Add missing newlines

---------

Co-authored-by: Iban Eguia Moraza <razican@protonmail.ch>
Co-authored-by: Haled Odat <8566042+HalidOdat@users.noreply.github.com>
Co-authored-by: José Julián Espina <jedel0124@gmail.com>
pull/3150/head
Alvin Kuruvilla 1 year ago committed by GitHub
parent
commit
de192d36e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      boa_engine/src/bigint.rs

18
boa_engine/src/bigint.rs

@ -390,6 +390,24 @@ impl From<u64> for JsBigInt {
} }
} }
impl From<i128> for JsBigInt {
#[inline]
fn from(value: i128) -> Self {
Self {
inner: Rc::new(RawBigInt::from(value)),
}
}
}
impl From<u128> for JsBigInt {
#[inline]
fn from(value: u128) -> Self {
Self {
inner: Rc::new(RawBigInt::from(value)),
}
}
}
impl From<isize> for JsBigInt { impl From<isize> for JsBigInt {
#[inline] #[inline]
fn from(value: isize) -> Self { fn from(value: isize) -> Self {

Loading…
Cancel
Save