mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +00:00
LibJS: Let isNaN() with no argument return true, add tests
This commit is contained in:
parent
602a36970f
commit
8ff2881b1a
2 changed files with 30 additions and 3 deletions
|
@ -137,9 +137,8 @@ Value GlobalObject::gc(Interpreter& interpreter)
|
|||
|
||||
Value GlobalObject::is_nan(Interpreter& interpreter)
|
||||
{
|
||||
if (interpreter.argument_count() < 1)
|
||||
return js_undefined();
|
||||
return Value(interpreter.argument(0).to_number().is_nan());
|
||||
auto value = interpreter.argument(0).to_number();
|
||||
return Value(value.is_nan());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue