mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 23:38:12 +00:00
LibJS: Convert to_primitive() to ThrowCompletionOr
This commit is contained in:
parent
96ab116f0d
commit
9eb065a1f6
4 changed files with 21 additions and 52 deletions
|
@ -48,9 +48,7 @@ Value BigIntConstructor::call()
|
|||
auto value = vm.argument(0);
|
||||
|
||||
// 2. Let prim be ? ToPrimitive(value, number).
|
||||
auto primitive = value.to_primitive(global_object, Value::PreferredType::Number);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
auto primitive = TRY_OR_DISCARD(value.to_primitive(global_object, Value::PreferredType::Number));
|
||||
|
||||
// 3. If Type(prim) is Number, return ? NumberToBigInt(prim).
|
||||
if (primitive.is_number())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue