mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-06 01:26:22 +00:00
LibJS: Convert to_bigint() to ThrowCompletionOr
This commit is contained in:
parent
b8f101888b
commit
e87cea8248
Notes:
sideshowbarker
2024-07-18 02:17:34 +09:00
Author: https://github.com/IdanHo
Commit: e87cea8248
Pull-request: https://github.com/SerenityOS/serenity/pull/10504
Reviewed-by: https://github.com/linusg
10 changed files with 27 additions and 56 deletions
|
@ -388,9 +388,7 @@ Optional<Wasm::Value> to_webassembly_value(JS::Value value, const Wasm::ValueTyp
|
|||
|
||||
switch (type.kind()) {
|
||||
case Wasm::ValueType::I64: {
|
||||
auto bigint = value.to_bigint(global_object);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
auto bigint = TRY_OR_DISCARD(value.to_bigint(global_object));
|
||||
auto value = bigint->big_integer().divided_by(two_64).remainder;
|
||||
VERIFY(value.unsigned_value().trimmed_length() <= 2);
|
||||
i64 integer = static_cast<i64>(value.unsigned_value().to_u64());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue