mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-28 20:29:42 +00:00
LibJS: Add global isNaN() function
This commit is contained in:
@@ -18,6 +18,11 @@ GlobalObject::GlobalObject()
|
||||
this_object->heap().collect_garbage();
|
||||
return js_undefined();
|
||||
});
|
||||
put_native_function("isNaN", [](Object*, Vector<Value> arguments) -> Value {
|
||||
if (arguments.size() < 1)
|
||||
return js_undefined();
|
||||
return Value(arguments[0].is_nan());
|
||||
});
|
||||
put("Math", heap().allocate<MathObject>());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user