mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:48:14 +00:00
LibJS: Implement Number.isFinite()
Like the global isFinite() without the number coercion.
This commit is contained in:
parent
b094c064d8
commit
c350f5ae67
6 changed files with 40 additions and 2 deletions
|
@ -144,8 +144,7 @@ Value GlobalObject::is_nan(Interpreter& interpreter)
|
|||
|
||||
Value GlobalObject::is_finite(Interpreter& interpreter)
|
||||
{
|
||||
auto value = interpreter.argument(0).to_number();
|
||||
return Value(!value.is_infinity() && !value.is_nan());
|
||||
return Value(interpreter.argument(0).to_number().is_finite_number());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue