diff options
author | Obinna Ikeh <hikenike6@gmail.com> | 2022-06-13 23:10:12 +0100 |
---|---|---|
committer | Brian Gianforcaro <b.gianfo@gmail.com> | 2022-06-13 17:37:11 -0700 |
commit | 3d99e83a86b3399e48a7ab9ec7f18a020a4be153 (patch) | |
tree | 3460a5f7dac8fdb7a169b40df0151ae865a9b814 /Userland/Libraries/LibJS/Runtime/Value.cpp | |
parent | 4e21835e7052b45f224302dbf6a1b8948f753911 (diff) | |
download | serenity-3d99e83a86b3399e48a7ab9ec7f18a020a4be153.zip |
LibJS: Update order of parameters in our is_less_than implementation
This change updates the parameter order of the is_less_than function
signature and calls to match accordingly with the spec
(https://tc39.es/ecma262/#sec-islessthan)
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/Value.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Value.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Value.cpp b/Userland/Libraries/LibJS/Runtime/Value.cpp index 8d20e21300..66838574e5 100644 --- a/Userland/Libraries/LibJS/Runtime/Value.cpp +++ b/Userland/Libraries/LibJS/Runtime/Value.cpp @@ -875,7 +875,7 @@ ThrowCompletionOr<Value> greater_than(GlobalObject& global_object, Value lhs, Va if (lhs.type() == Value::Type::Int32 && rhs.type() == Value::Type::Int32) return lhs.as_i32() > rhs.as_i32(); - TriState relation = TRY(is_less_than(global_object, false, lhs, rhs)); + TriState relation = TRY(is_less_than(global_object, lhs, rhs, false)); if (relation == TriState::Unknown) return Value(false); return Value(relation == TriState::True); @@ -887,7 +887,7 @@ ThrowCompletionOr<Value> greater_than_equals(GlobalObject& global_object, Value if (lhs.type() == Value::Type::Int32 && rhs.type() == Value::Type::Int32) return lhs.as_i32() >= rhs.as_i32(); - TriState relation = TRY(is_less_than(global_object, true, lhs, rhs)); + TriState relation = TRY(is_less_than(global_object, lhs, rhs, true)); if (relation == TriState::Unknown || relation == TriState::True) return Value(false); return Value(true); @@ -899,7 +899,7 @@ ThrowCompletionOr<Value> less_than(GlobalObject& global_object, Value lhs, Value if (lhs.type() == Value::Type::Int32 && rhs.type() == Value::Type::Int32) return lhs.as_i32() < rhs.as_i32(); - TriState relation = TRY(is_less_than(global_object, true, lhs, rhs)); + TriState relation = TRY(is_less_than(global_object, lhs, rhs, true)); if (relation == TriState::Unknown) return Value(false); return Value(relation == TriState::True); @@ -911,7 +911,7 @@ ThrowCompletionOr<Value> less_than_equals(GlobalObject& global_object, Value lhs if (lhs.type() == Value::Type::Int32 && rhs.type() == Value::Type::Int32) return lhs.as_i32() <= rhs.as_i32(); - TriState relation = TRY(is_less_than(global_object, false, lhs, rhs)); + TriState relation = TRY(is_less_than(global_object, lhs, rhs, false)); if (relation == TriState::Unknown || relation == TriState::True) return Value(false); return Value(true); @@ -1523,7 +1523,7 @@ ThrowCompletionOr<bool> is_loosely_equal(GlobalObject& global_object, Value lhs, } // 7.2.13 IsLessThan ( x, y, LeftFirst ), https://tc39.es/ecma262/#sec-islessthan -ThrowCompletionOr<TriState> is_less_than(GlobalObject& global_object, bool left_first, Value lhs, Value rhs) +ThrowCompletionOr<TriState> is_less_than(GlobalObject& global_object, Value lhs, Value rhs, bool left_first) { Value x_primitive; Value y_primitive; |