mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibJS: Use INVALID some more in abstract operations
This commit is contained in:
parent
8ff0afd829
commit
c55cb7843a
Notes:
sideshowbarker
2024-07-19 00:00:03 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/c55cb7843a1 Pull-request: https://github.com/SerenityOS/serenity/pull/4869
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…
Reference in a new issue