mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-30 05:09:01 +00:00
LibJS: Add spec comments to Value::is_function()
This commit is contained in:
parent
aaa4fe8c34
commit
b11135cbc2
Notes:
sideshowbarker
2024-07-17 03:33:31 +09:00
Author: https://github.com/linusg
Commit: b11135cbc2
Pull-request: https://github.com/SerenityOS/serenity/pull/16405
Reviewed-by: https://github.com/davidot ✅
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