From 9f93b0a8eecb44f13bb9a281428a57895db0b6e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20B=C3=A1tyai?= Date: Mon, 28 Sep 2020 16:01:38 +0200 Subject: [PATCH] Fix Symbol to Object comparison (#4226) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai daniel.batyai@h-lab.eu --- jerry-core/ecma/operations/ecma-comparison.c | 10 +++++++++- tests/test262-es6-excludelist.xml | 1 - tests/test262-esnext-excludelist.xml | 1 - 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/jerry-core/ecma/operations/ecma-comparison.c b/jerry-core/ecma/operations/ecma-comparison.c index 988bca810..a58508bb8 100644 --- a/jerry-core/ecma/operations/ecma-comparison.c +++ b/jerry-core/ecma/operations/ecma-comparison.c @@ -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) */ diff --git a/tests/test262-es6-excludelist.xml b/tests/test262-es6-excludelist.xml index 7688ac9ce..d48395bfa 100644 --- a/tests/test262-es6-excludelist.xml +++ b/tests/test262-es6-excludelist.xml @@ -269,7 +269,6 @@ - ES2016 change: Generator methods isn't constructor - https://github.com/tc39/ecma262/pull/171 diff --git a/tests/test262-esnext-excludelist.xml b/tests/test262-esnext-excludelist.xml index a8a9fcf89..05154322c 100644 --- a/tests/test262-esnext-excludelist.xml +++ b/tests/test262-esnext-excludelist.xml @@ -3622,7 +3622,6 @@ -