1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-10 03:47:34 +00:00

LibWeb: Use SignedBigInteger::create() to create wasm i64 values

...instead of the terrible from_base10(...to_base10()) hack.
This commit is contained in:
Ali Mohammad Pur 2021-06-21 03:50:00 +04:30 committed by Ali Mohammad Pur
parent baa4195daa
commit a256997064

View file

@ -251,8 +251,7 @@ JS::Value to_js_value(Wasm::Value& wasm_value, JS::GlobalObject& global_object)
{
switch (wasm_value.type().kind()) {
case Wasm::ValueType::I64:
// FIXME: This is extremely silly...
return global_object.heap().allocate<JS::BigInt>(global_object, Crypto::SignedBigInteger::from_base10(String::number(wasm_value.to<i64>().value())));
return global_object.heap().allocate<JS::BigInt>(global_object, Crypto::SignedBigInteger::create_from(wasm_value.to<i64>().value()));
case Wasm::ValueType::I32:
return JS::Value(wasm_value.to<i32>().value());
case Wasm::ValueType::F64: