mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:37:36 +00:00
LibJS: Make length_of_array_like() take an Object rather than Value
The pseudo-code from the spec says "Assert: Type(obj) is Object.", so we can just enforce this at compile time rather than taking it literally and doing "ASSERT(value.is_object())". Also fix an issue where the absence of a "length" property on the object would cause a crash (to_number() on empty value).
This commit is contained in:
parent
a5e557472c
commit
9be0b664e3
3 changed files with 10 additions and 9 deletions
|
@ -341,7 +341,7 @@ bool same_value(Value lhs, Value rhs);
|
|||
bool same_value_zero(Value lhs, Value rhs);
|
||||
bool same_value_non_numeric(Value lhs, Value rhs);
|
||||
TriState abstract_relation(GlobalObject&, bool left_first, Value lhs, Value rhs);
|
||||
size_t length_of_array_like(GlobalObject&, Value);
|
||||
size_t length_of_array_like(GlobalObject&, const Object&);
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue