mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:57:35 +00:00
LibJS: Use INVALID some more in abstract operations
This commit is contained in:
parent
8ff0afd829
commit
c55cb7843a
1 changed files with 2 additions and 2 deletions
|
@ -480,7 +480,7 @@ double Value::to_double(GlobalObject& global_object) const
|
|||
{
|
||||
auto number = to_number(global_object);
|
||||
if (global_object.vm().exception())
|
||||
return 0;
|
||||
return INVALID;
|
||||
return number.as_double();
|
||||
}
|
||||
|
||||
|
@ -488,7 +488,7 @@ i32 Value::to_i32(GlobalObject& global_object) const
|
|||
{
|
||||
auto number = to_number(global_object);
|
||||
if (global_object.vm().exception())
|
||||
return 0;
|
||||
return INVALID;
|
||||
if (number.is_nan() || number.is_infinity())
|
||||
return 0;
|
||||
return number.as_i32();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue