fix check order in ecma_op_abstract_equality_compare (#4141)

Fixes #4139

JerryScript-DCO-1.0-Signed-off-by: bence gabor kis kisbg@inf.u-szeged.hu
This commit is contained in:
kisbg
2020-08-18 13:50:58 +02:00
committed by GitHub
parent 086d1cc127
commit d9cb2c60f2
2 changed files with 26 additions and 10 deletions
+10 -10
View File
@@ -151,16 +151,6 @@ ecma_op_abstract_equality_compare (ecma_value_t x, /**< first operand */
return ecma_op_abstract_equality_compare (ecma_make_integer_value (ecma_is_value_true (x) ? 1 : 0), y);
}
if (ecma_is_value_undefined (x)
|| ecma_is_value_null (x))
{
/* 1. a., b. */
/* 2., 3. */
bool is_equal = ecma_is_value_undefined (y) || ecma_is_value_null (y);
return ecma_make_boolean_value (is_equal);
}
#if ENABLED (JERRY_BUILTIN_BIGINT)
if (JERRY_UNLIKELY (ecma_is_value_bigint (x)))
{
@@ -199,6 +189,16 @@ ecma_op_abstract_equality_compare (ecma_value_t x, /**< first operand */
}
#endif /* ENABLED (JERRY_BUILTIN_BIGINT) */
if (ecma_is_value_undefined (x)
|| ecma_is_value_null (x))
{
/* 1. a., b. */
/* 2., 3. */
bool is_equal = ecma_is_value_undefined (y) || ecma_is_value_null (y);
return ecma_make_boolean_value (is_equal);
}
#if ENABLED (JERRY_ESNEXT)
if (JERRY_UNLIKELY (ecma_is_value_symbol (x)))
{