1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 03:08:13 +00:00

LibJS: Rename abstract_relation() to is_less_than()

This got turned into a proper AO with a new name recently.

See: 587adc0
This commit is contained in:
Linus Groh 2021-09-23 23:49:52 +02:00
parent 580a7e0f7c
commit facbe32fcd
3 changed files with 9 additions and 9 deletions

View file

@ -1146,11 +1146,11 @@ static void array_merge_sort(VM& vm, GlobalObject& global_object, FunctionObject
auto x_string_value = Value(x_string);
auto y_string_value = Value(y_string);
// Because they are called with primitive strings, these abstract_relation calls
// Because they are called with primitive strings, these is_less_than calls
// should never result in a VM exception.
auto x_lt_y_relation = abstract_relation(global_object, true, x_string_value, y_string_value);
auto x_lt_y_relation = is_less_than(global_object, true, x_string_value, y_string_value);
VERIFY(x_lt_y_relation != TriState::Unknown);
auto y_lt_x_relation = abstract_relation(global_object, true, y_string_value, x_string_value);
auto y_lt_x_relation = is_less_than(global_object, true, y_string_value, x_string_value);
VERIFY(y_lt_x_relation != TriState::Unknown);
if (x_lt_y_relation == TriState::True) {

View file

@ -843,7 +843,7 @@ ThrowCompletionOr<FunctionObject*> Value::get_method(GlobalObject& global_object
// 13.10 Relational Operators, https://tc39.es/ecma262/#sec-relational-operators
Value greater_than(GlobalObject& global_object, Value lhs, Value rhs)
{
TriState relation = abstract_relation(global_object, false, lhs, rhs);
TriState relation = is_less_than(global_object, false, lhs, rhs);
if (relation == TriState::Unknown)
return Value(false);
return Value(relation == TriState::True);
@ -852,7 +852,7 @@ Value greater_than(GlobalObject& global_object, Value lhs, Value rhs)
// 13.10 Relational Operators, https://tc39.es/ecma262/#sec-relational-operators
Value greater_than_equals(GlobalObject& global_object, Value lhs, Value rhs)
{
TriState relation = abstract_relation(global_object, true, lhs, rhs);
TriState relation = is_less_than(global_object, true, lhs, rhs);
if (relation == TriState::Unknown || relation == TriState::True)
return Value(false);
return Value(true);
@ -861,7 +861,7 @@ Value greater_than_equals(GlobalObject& global_object, Value lhs, Value rhs)
// 13.10 Relational Operators, https://tc39.es/ecma262/#sec-relational-operators
Value less_than(GlobalObject& global_object, Value lhs, Value rhs)
{
TriState relation = abstract_relation(global_object, true, lhs, rhs);
TriState relation = is_less_than(global_object, true, lhs, rhs);
if (relation == TriState::Unknown)
return Value(false);
return Value(relation == TriState::True);
@ -870,7 +870,7 @@ Value less_than(GlobalObject& global_object, Value lhs, Value rhs)
// 13.10 Relational Operators, https://tc39.es/ecma262/#sec-relational-operators
Value less_than_equals(GlobalObject& global_object, Value lhs, Value rhs)
{
TriState relation = abstract_relation(global_object, false, lhs, rhs);
TriState relation = is_less_than(global_object, false, lhs, rhs);
if (relation == TriState::Unknown || relation == TriState::True)
return Value(false);
return Value(true);
@ -1492,7 +1492,7 @@ bool is_loosely_equal(GlobalObject& global_object, Value lhs, Value rhs)
}
// 7.2.13 IsLessThan ( x, y, LeftFirst ), https://tc39.es/ecma262/#sec-islessthan
TriState abstract_relation(GlobalObject& global_object, bool left_first, Value lhs, Value rhs)
TriState is_less_than(GlobalObject& global_object, bool left_first, Value lhs, Value rhs)
{
Value x_primitive;
Value y_primitive;

View file

@ -375,7 +375,7 @@ bool is_strictly_equal(Value lhs, Value rhs);
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);
TriState is_less_than(GlobalObject&, bool left_first, Value lhs, Value rhs);
inline bool Value::operator==(Value const& value) const { return same_value(*this, value); }