mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 07:18:13 +00:00
LibJS: Spec-compliant equality comparisons
The ECMAScript spec defines multiple equality operations which are used all over the spec; this patch introduces them. Of course, the two primary equality operations are AbtractEquals ('==') and StrictEquals ('==='), which have been renamed to 'abstract_eq' and 'strict_eq' in this patch. In support of the two operations mentioned above, the following have also been added: SameValue, SameValueZero, and SameValueNonNumeric. These are important to have, because they are used elsewhere in the spec aside from the two primary equality comparisons.
This commit is contained in:
parent
cc01933840
commit
532d4bc0ab
6 changed files with 126 additions and 82 deletions
|
@ -233,11 +233,15 @@ Value mul(Interpreter&, Value lhs, Value rhs);
|
|||
Value div(Interpreter&, Value lhs, Value rhs);
|
||||
Value mod(Interpreter&, Value lhs, Value rhs);
|
||||
Value exp(Interpreter&, Value lhs, Value rhs);
|
||||
Value eq(Interpreter&, Value lhs, Value rhs);
|
||||
Value typed_eq(Interpreter&, Value lhs, Value rhs);
|
||||
Value in(Interpreter&, Value lhs, Value rhs);
|
||||
Value instance_of(Interpreter&, Value lhs, Value rhs);
|
||||
|
||||
bool abstract_eq(Interpreter&, Value lhs, Value rhs);
|
||||
bool strict_eq(Interpreter&, Value lhs, Value rhs);
|
||||
bool same_value(Interpreter&, Value lhs, Value rhs);
|
||||
bool same_value_zero(Interpreter&, Value lhs, Value rhs);
|
||||
bool same_value_non_numeric(Interpreter&, Value lhs, Value rhs);
|
||||
|
||||
const LogStream& operator<<(const LogStream&, const Value&);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue