mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-03 16:16:43 +00:00
LibJS: Add Value::operator==()
This is needed for MarkedValueList::contains_slow() to work.
This commit is contained in:
parent
c9d8aa6139
commit
c81001f920
Notes:
sideshowbarker
2024-07-18 10:26:46 +09:00
Author: https://github.com/linusg
Commit: c81001f920
Pull-request: https://github.com/SerenityOS/serenity/pull/8262
Reviewed-by: https://github.com/IdanHo
Reviewed-by: https://github.com/alimpfard ✅
Reviewed-by: https://github.com/awesomekling ✅
Reviewed-by: https://github.com/davidot
Reviewed-by: https://github.com/mattco98
1 changed files with 4 additions and 0 deletions
|
@ -301,6 +301,8 @@ public:
|
|||
|
||||
String typeof() const;
|
||||
|
||||
bool operator==(Value const&) const;
|
||||
|
||||
private:
|
||||
Type m_type { Type::Empty };
|
||||
|
||||
|
@ -383,6 +385,8 @@ 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);
|
||||
|
||||
inline bool Value::operator==(Value const& value) const { return same_value(*this, value); }
|
||||
|
||||
struct ValueTraits : public Traits<Value> {
|
||||
static unsigned hash(Value value)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue