1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 04:47:34 +00:00

LibJS: Add spec comments to Value::is_function()

This commit is contained in:
Linus Groh 2022-12-09 23:55:11 +00:00
parent aaa4fe8c34
commit b11135cbc2

View file

@ -241,6 +241,9 @@ Array& Value::as_array()
// 7.2.3 IsCallable ( argument ), https://tc39.es/ecma262/#sec-iscallable
bool Value::is_function() const
{
// 1. If argument is not an Object, return false.
// 2. If argument has a [[Call]] internal method, return true.
// 3. Return false.
return is_object() && as_object().is_function();
}