Fix Symbol to Object comparison (#4226)

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai daniel.batyai@h-lab.eu
This commit is contained in:
Dániel Bátyai
2020-09-28 16:01:38 +02:00
committed by GitHub
parent 75385a6045
commit 9f93b0a8ee
3 changed files with 9 additions and 3 deletions
+9 -1
View File
@@ -202,7 +202,15 @@ ecma_op_abstract_equality_compare (ecma_value_t x, /**< first operand */
#if ENABLED (JERRY_ESNEXT)
if (JERRY_UNLIKELY (ecma_is_value_symbol (x)))
{
return ECMA_VALUE_FALSE;
if (!ecma_is_value_object (y))
{
return ECMA_VALUE_FALSE;
}
/* Swap values. */
x ^= y;
y ^= x;
x ^= y;
}
#endif /* ENABLED (JERRY_ESNEXT) */