From facbe32fcdb68695152e682bf7ee508fad8f83d2 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Thu, 23 Sep 2021 23:49:52 +0200 Subject: [PATCH] LibJS: Rename abstract_relation() to is_less_than() This got turned into a proper AO with a new name recently. See: https://github.com/tc39/ecma262/commit/587adc0 --- Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp | 6 +++--- Userland/Libraries/LibJS/Runtime/Value.cpp | 10 +++++----- Userland/Libraries/LibJS/Runtime/Value.h | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp b/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp index c49bca97f0..d9b7010fd4 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp @@ -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) { diff --git a/Userland/Libraries/LibJS/Runtime/Value.cpp b/Userland/Libraries/LibJS/Runtime/Value.cpp index b255f628e2..bbb403361a 100644 --- a/Userland/Libraries/LibJS/Runtime/Value.cpp +++ b/Userland/Libraries/LibJS/Runtime/Value.cpp @@ -843,7 +843,7 @@ ThrowCompletionOr 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; diff --git a/Userland/Libraries/LibJS/Runtime/Value.h b/Userland/Libraries/LibJS/Runtime/Value.h index 6a1eb7a0fb..626500d4e0 100644 --- a/Userland/Libraries/LibJS/Runtime/Value.h +++ b/Userland/Libraries/LibJS/Runtime/Value.h @@ -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); }