mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
LibJS: Rename strict_eq() to is_strictly_equal()
This got turned into a proper AO with a new name recently. See: https://github.com/tc39/ecma262/commit/19d7ca4
This commit is contained in:
parent
bc5a04f798
commit
c7ff89891c
Notes:
sideshowbarker
2024-07-18 03:30:39 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/c7ff89891c5 Pull-request: https://github.com/SerenityOS/serenity/pull/10191 Reviewed-by: https://github.com/awesomekling ✅
6 changed files with 12 additions and 12 deletions
|
@ -656,9 +656,9 @@ Value BinaryExpression::execute(Interpreter& interpreter, GlobalObject& global_o
|
|||
case BinaryOp::Exponentiation:
|
||||
return exp(global_object, lhs_result, rhs_result);
|
||||
case BinaryOp::TypedEquals:
|
||||
return Value(strict_eq(lhs_result, rhs_result));
|
||||
return Value(is_strictly_equal(lhs_result, rhs_result));
|
||||
case BinaryOp::TypedInequals:
|
||||
return Value(!strict_eq(lhs_result, rhs_result));
|
||||
return Value(!is_strictly_equal(lhs_result, rhs_result));
|
||||
case BinaryOp::AbstractEquals:
|
||||
return Value(abstract_eq(global_object, lhs_result, rhs_result));
|
||||
case BinaryOp::AbstractInequals:
|
||||
|
@ -2423,7 +2423,7 @@ Value SwitchStatement::execute(Interpreter& interpreter, GlobalObject& global_ob
|
|||
auto test_result = switch_case.test()->execute(interpreter, global_object);
|
||||
if (interpreter.exception())
|
||||
return {};
|
||||
if (!strict_eq(discriminant_result, test_result))
|
||||
if (!is_strictly_equal(discriminant_result, test_result))
|
||||
continue;
|
||||
}
|
||||
falling_through = true;
|
||||
|
|
|
@ -67,12 +67,12 @@ static Value abstract_equals(GlobalObject& global_object, Value src1, Value src2
|
|||
|
||||
static Value typed_inequals(GlobalObject&, Value src1, Value src2)
|
||||
{
|
||||
return Value(!strict_eq(src1, src2));
|
||||
return Value(!is_strictly_equal(src1, src2));
|
||||
}
|
||||
|
||||
static Value typed_equals(GlobalObject&, Value src1, Value src2)
|
||||
{
|
||||
return Value(strict_eq(src1, src2));
|
||||
return Value(is_strictly_equal(src1, src2));
|
||||
}
|
||||
|
||||
#define JS_DEFINE_COMMON_BINARY_OP(OpTitleCase, op_snake_case) \
|
||||
|
|
|
@ -806,7 +806,7 @@ JS_DEFINE_NATIVE_FUNCTION(ArrayPrototype::index_of)
|
|||
return {};
|
||||
|
||||
// ii. Let same be IsStrictlyEqual(searchElement, elementK).
|
||||
auto same = strict_eq(search_element, element_k);
|
||||
auto same = is_strictly_equal(search_element, element_k);
|
||||
|
||||
// iii. If same is true, return 𝔽(k).
|
||||
if (same)
|
||||
|
@ -1302,7 +1302,7 @@ JS_DEFINE_NATIVE_FUNCTION(ArrayPrototype::last_index_of)
|
|||
return {};
|
||||
|
||||
// ii. Let same be IsStrictlyEqual(searchElement, elementK).
|
||||
auto same = strict_eq(search_element, element_k);
|
||||
auto same = is_strictly_equal(search_element, element_k);
|
||||
|
||||
// iii. If same is true, return 𝔽(k).
|
||||
if (same)
|
||||
|
|
|
@ -451,7 +451,7 @@ JS_DEFINE_NATIVE_FUNCTION(TypedArrayPrototype::index_of)
|
|||
if (k_present) {
|
||||
auto element_k = typed_array->get(k);
|
||||
|
||||
if (strict_eq(search_element, element_k))
|
||||
if (is_strictly_equal(search_element, element_k))
|
||||
return Value(k);
|
||||
}
|
||||
}
|
||||
|
@ -499,7 +499,7 @@ JS_DEFINE_NATIVE_FUNCTION(TypedArrayPrototype::last_index_of)
|
|||
if (k_present) {
|
||||
auto element_k = typed_array->get(k);
|
||||
|
||||
if (strict_eq(search_element, element_k))
|
||||
if (is_strictly_equal(search_element, element_k))
|
||||
return Value(k);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1405,7 +1405,7 @@ bool same_value_non_numeric(Value lhs, Value rhs)
|
|||
}
|
||||
|
||||
// 7.2.15 IsStrictlyEqual ( x, y ), https://tc39.es/ecma262/#sec-isstrictlyequal
|
||||
bool strict_eq(Value lhs, Value rhs)
|
||||
bool is_strictly_equal(Value lhs, Value rhs)
|
||||
{
|
||||
if (!same_type_for_equality(lhs, rhs))
|
||||
return false;
|
||||
|
@ -1430,7 +1430,7 @@ bool abstract_eq(GlobalObject& global_object, Value lhs, Value rhs)
|
|||
auto& vm = global_object.vm();
|
||||
|
||||
if (same_type_for_equality(lhs, rhs))
|
||||
return strict_eq(lhs, rhs);
|
||||
return is_strictly_equal(lhs, rhs);
|
||||
|
||||
if (lhs.is_nullish() && rhs.is_nullish())
|
||||
return true;
|
||||
|
|
|
@ -371,7 +371,7 @@ Value instance_of(GlobalObject&, Value lhs, Value rhs);
|
|||
Value ordinary_has_instance(GlobalObject&, Value lhs, Value rhs);
|
||||
|
||||
bool abstract_eq(GlobalObject&, Value lhs, Value rhs);
|
||||
bool strict_eq(Value lhs, Value rhs);
|
||||
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);
|
||||
|
|
Loading…
Reference in a new issue