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:
parent
baa4195daa
commit
a256997064
1 changed files with 1 additions and 2 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue