mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 16:18:12 +00:00
LibJS: Implement <= and >= binary operators
This commit is contained in:
parent
fdf7f81ba9
commit
0fe87c5fec
6 changed files with 38 additions and 0 deletions
|
@ -96,6 +96,13 @@ Value greater_than(Value lhs, Value rhs)
|
|||
return Value(lhs.as_double() > rhs.as_double());
|
||||
}
|
||||
|
||||
Value greater_than_equals(Value lhs, Value rhs)
|
||||
{
|
||||
ASSERT(lhs.is_number());
|
||||
ASSERT(rhs.is_number());
|
||||
return Value(lhs.as_double() >= rhs.as_double());
|
||||
}
|
||||
|
||||
Value less_than(Value lhs, Value rhs)
|
||||
{
|
||||
ASSERT(lhs.is_number());
|
||||
|
@ -103,6 +110,13 @@ Value less_than(Value lhs, Value rhs)
|
|||
return Value(lhs.as_double() < rhs.as_double());
|
||||
}
|
||||
|
||||
Value less_than_equals(Value lhs, Value rhs)
|
||||
{
|
||||
ASSERT(lhs.is_number());
|
||||
ASSERT(rhs.is_number());
|
||||
return Value(lhs.as_double() <= rhs.as_double());
|
||||
}
|
||||
|
||||
Value bitwise_and(Value lhs, Value rhs)
|
||||
{
|
||||
ASSERT(lhs.is_number());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue