mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:37:36 +00:00
LibJS: Add spec comments to Value::is_function()
This commit is contained in:
parent
aaa4fe8c34
commit
b11135cbc2
1 changed files with 3 additions and 0 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue