mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 01:29:17 +00:00
LibJS: Implement <= and >= binary operators
This commit is contained in:
parent
fdf7f81ba9
commit
0fe87c5fec
Notes:
sideshowbarker
2024-07-19 08:45:08 +09:00
Author: https://github.com/deoxxa
Commit: 0fe87c5fec
Pull-request: https://github.com/SerenityOS/serenity/pull/1425
Reviewed-by: https://github.com/sunverwerth
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