Implement the Symbol builtin object (#2601)

This patch contains the base functionalities that the new builtin object requires.

Currently unavailable:
 - print (Symbol('foo')) - this features requires the refactor of the print handler function
 - Several global symbol based builtin routines (follow up patch)

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
Robert Fancsik
2019-01-16 10:09:23 +01:00
committed by Robert Sipka
parent 08c7183ef8
commit 7e3d688e5b
43 changed files with 1896 additions and 212 deletions
@@ -125,6 +125,13 @@ ecma_op_abstract_equality_compare (ecma_value_t x, /**< first operand */
y = tmp;
}
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
if (ecma_is_value_symbol (x))
{
return ECMA_VALUE_FALSE;
}
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
if (ecma_is_value_boolean (y))
{
if (ecma_is_value_boolean (x))
@@ -141,6 +148,9 @@ ecma_op_abstract_equality_compare (ecma_value_t x, /**< first operand */
if (ecma_is_value_object (x))
{
if (ecma_is_value_string (y)
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|| ecma_is_value_symbol (y)
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|| ecma_is_value_number (y))
{
/* 9. */
@@ -195,6 +205,10 @@ ecma_op_strict_equality_compare (ecma_value_t x, /**< first operand */
{
if (ecma_is_value_direct (x)
|| ecma_is_value_direct (y)
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|| ecma_is_value_symbol (x)
|| ecma_is_value_symbol (y)
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|| ecma_is_value_object (x)
|| ecma_is_value_object (y))
{