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

This commit is contained in:
Linus Groh 2022-12-09 23:55:11 +00:00
commit b11135cbc2
Notes: sideshowbarker 2024-07-17 03:33:31 +09:00

View file

@ -241,6 +241,9 @@ Array& Value::as_array()
// 7.2.3 IsCallable ( argument ), https://tc39.es/ecma262/#sec-iscallable // 7.2.3 IsCallable ( argument ), https://tc39.es/ecma262/#sec-iscallable
bool Value::is_function() const 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(); return is_object() && as_object().is_function();
} }