Rework usages/naming of configuration macros [part 1] (#2793)
There are quite a few configuration macros in the project. As discussed in the #2520 issue there are a few awkward constructs. Main changes: * Renamed all CONFIG_DISABLE_<name>_BUILTIN macro to JERRY_BUILTIN_<name> format. * The special JERRY_BUILTINS macro specifies the basic config for all es5.1 builtins. * Renamed all CONFIG_DISABLE_ES2015_<name> to JERRY_ES2015_<name> format. * The special JERRY_ES2015 macro specifies the basic config for all es2015 builtins. * Renamed UNICODE_CASE_CONVERSION to JERRY_UNICODE_CASE_CONVERSION. * Renamed ENABLE_REGEXP_STRICT_MODE to JERRY_REGEXP_STRICT_MODE. * All options (in this change) can have a value of 0 or 1. * Renamed ENABLE_REGEXP_STRICT_MODE to JERRY_REGEXP_STRICT_MODE. JERRY_REGEXP_STRICT_MODE is set to 0 by default. * Reworked CONFIG_ECMA_NUMBER_TYPE macro to JERRY_NUMBER_TYPE_FLOAT64 name and now it uses the value 1 for 64 bit floating point numbers and 0 for 32 bit floating point number. By default the 64-bit floating point number mode is enabled. * All new JERRY_ defines can be used wit the `#if ENABLED (JERRY_...)` construct to test if the feature is enabled or not. * Added/replaced a few config.h includes to correctly propagate the macro values. * Added sanity checks for each macro to avoid incorrectly set values. * Updated profile documentation. * The CMake feature names are not updated at this point. JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
This commit is contained in:
committed by
Robert Fancsik
parent
722d092528
commit
40f7b1c27f
@@ -85,11 +85,11 @@ ecma_op_create_array_object (const ecma_value_t *arguments_list_p, /**< list of
|
||||
array_items_count = arguments_list_len;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_DISABLE_ARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_ARRAY)
|
||||
ecma_object_t *array_prototype_object_p = ecma_builtin_get (ECMA_BUILTIN_ID_ARRAY_PROTOTYPE);
|
||||
#else /* CONFIG_DISABLE_ARRAY_BUILTIN */
|
||||
#else /* ENABLED (JERRY_BUILTIN_ARRAY) */
|
||||
ecma_object_t *array_prototype_object_p = ecma_builtin_get (ECMA_BUILTIN_ID_OBJECT_PROTOTYPE);
|
||||
#endif /* !CONFIG_DISABLE_ARRAY_BUILTIN */
|
||||
#endif /* !(ENABLED (JERRY_BUILTIN_ARRAY)) */
|
||||
|
||||
ecma_object_t *object_p = ecma_create_object (array_prototype_object_p,
|
||||
sizeof (ecma_extended_object_t),
|
||||
@@ -128,7 +128,7 @@ ecma_op_create_array_object (const ecma_value_t *arguments_list_p, /**< list of
|
||||
return ecma_make_object_value (object_p);
|
||||
} /* ecma_op_create_array_object */
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
/**
|
||||
* Array object creation with custom prototype.
|
||||
*
|
||||
@@ -159,7 +159,7 @@ ecma_op_create_array_object_by_constructor (const ecma_value_t *arguments_list_p
|
||||
arguments_list_len,
|
||||
is_treat_single_arg_as_length);
|
||||
} /* ecma_op_create_array_object_by_constructor */
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
|
||||
/**
|
||||
* Update the length of an array to a new length
|
||||
|
||||
@@ -43,11 +43,11 @@ ecma_value_t
|
||||
ecma_op_create_array_object (const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len,
|
||||
bool is_treat_single_arg_as_length);
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
ecma_value_t
|
||||
ecma_op_create_array_object_by_constructor (const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len,
|
||||
bool is_treat_single_arg_as_length, ecma_object_t *object_p);
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
|
||||
ecma_value_t
|
||||
ecma_op_array_object_set_length (ecma_object_t *object_p, ecma_value_t new_value, uint32_t flags);
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "ecma-helpers.h"
|
||||
#include "jmem.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
|
||||
/** \addtogroup ecma ECMA
|
||||
* @{
|
||||
@@ -207,4 +207,4 @@ ecma_arraybuffer_get_buffer (ecma_object_t *object_p) /**< pointer to the ArrayB
|
||||
* @}
|
||||
* @}
|
||||
*/
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
|
||||
@@ -16,9 +16,10 @@
|
||||
#ifndef ECMA_ARRAYBUFFER_OBJECT_H
|
||||
#define ECMA_ARRAYBUFFER_OBJECT_H
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#include "ecma-globals.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
|
||||
/** \addtogroup ecma ECMA
|
||||
* @{
|
||||
*
|
||||
@@ -50,5 +51,5 @@ ecma_is_arraybuffer (ecma_value_t val);
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#endif /* !ECMA_ARRAYBUFFER_OBJECT_H */
|
||||
|
||||
@@ -43,11 +43,11 @@ ecma_op_create_boolean_object (ecma_value_t arg) /**< argument passed to the Boo
|
||||
{
|
||||
bool boolean_value = ecma_op_to_boolean (arg);
|
||||
|
||||
#ifndef CONFIG_DISABLE_BOOLEAN_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_BOOLEAN)
|
||||
ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_BOOLEAN_PROTOTYPE);
|
||||
#else /* CONFIG_DISABLE_BOOLEAN_BUILTIN */
|
||||
#else /* ENABLED (JERRY_BUILTIN_BOOLEAN) */
|
||||
ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_OBJECT_PROTOTYPE);
|
||||
#endif /* !CONFIG_DISABLE_BOOLEAN_BUILTIN */
|
||||
#endif /* !(ENABLED (JERRY_BUILTIN_BOOLEAN) */
|
||||
|
||||
ecma_object_t *object_p = ecma_create_object (prototype_obj_p,
|
||||
sizeof (ecma_extended_object_t),
|
||||
|
||||
@@ -130,12 +130,12 @@ ecma_op_abstract_equality_compare (ecma_value_t x, /**< first operand */
|
||||
y = tmp;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
if (ecma_is_value_symbol (x))
|
||||
{
|
||||
return ECMA_VALUE_FALSE;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
if (ecma_is_value_boolean (y))
|
||||
{
|
||||
@@ -153,9 +153,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
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
|| ecma_is_value_symbol (y)
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|| ecma_is_value_number (y))
|
||||
{
|
||||
/* 9. */
|
||||
@@ -210,10 +210,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
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
|| ecma_is_value_symbol (x)
|
||||
|| ecma_is_value_symbol (y)
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|| ecma_is_value_object (x)
|
||||
|| ecma_is_value_object (y))
|
||||
{
|
||||
|
||||
@@ -259,12 +259,12 @@ ecma_op_to_number (ecma_value_t value) /**< ecma value */
|
||||
ecma_string_t *str_p = ecma_get_string_from_value (value);
|
||||
return ecma_make_number_value (ecma_string_to_number (str_p));
|
||||
}
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
if (ecma_is_value_symbol (value))
|
||||
{
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Cannot convert a Symbol value to a number."));
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
if (ecma_is_value_object (value))
|
||||
{
|
||||
@@ -360,12 +360,12 @@ ecma_get_number (ecma_value_t value, /**< ecma value*/
|
||||
return ECMA_VALUE_EMPTY;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
if (ecma_is_value_symbol (value))
|
||||
{
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Cannot convert a Symbol value to a number."));
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
JERRY_ASSERT (ecma_is_value_boolean (value));
|
||||
|
||||
@@ -435,13 +435,13 @@ ecma_to_op_string_helper (ecma_value_t value) /**< ecma value */
|
||||
{
|
||||
return ecma_get_magic_string (LIT_MAGIC_STRING_NULL);
|
||||
}
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
else if (ecma_is_value_symbol (value))
|
||||
{
|
||||
ecma_raise_type_error (ECMA_ERR_MSG ("Cannot convert a Symbol value to a string."));
|
||||
return NULL;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
JERRY_ASSERT (ecma_is_value_boolean (value));
|
||||
|
||||
if (ecma_is_value_true (value))
|
||||
@@ -488,14 +488,14 @@ ecma_op_to_prop_name (ecma_value_t value) /**< ecma value */
|
||||
{
|
||||
ecma_check_value_type_is_spec_defined (value);
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
if (ecma_is_value_symbol (value))
|
||||
{
|
||||
ecma_string_t *symbol_p = ecma_get_symbol_from_value (value);
|
||||
ecma_ref_ecma_string (symbol_p);
|
||||
return symbol_p;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
return ecma_to_op_string_helper (value);
|
||||
} /* ecma_op_to_prop_name */
|
||||
@@ -526,12 +526,12 @@ ecma_op_to_object (ecma_value_t value) /**< ecma value */
|
||||
{
|
||||
return ecma_copy_value (value);
|
||||
}
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
else if (ecma_is_value_symbol (value))
|
||||
{
|
||||
return ecma_op_create_symbol_object (value);
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
else
|
||||
{
|
||||
if (ecma_is_value_undefined (value)
|
||||
|
||||
@@ -95,11 +95,11 @@ ecma_op_eval_chars_buffer (const lit_utf8_byte_t *code_p, /**< code characters b
|
||||
JERRY_CONTEXT (resource_name) = ecma_make_magic_string_value (LIT_MAGIC_STRING__EMPTY);
|
||||
#endif /* JERRY_ENABLE_LINE_INFO */
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
parse_opts |= ECMA_GET_SUPER_EVAL_PARSER_OPTS ();
|
||||
|
||||
ECMA_CLEAR_SUPER_EVAL_PARSER_OPTS ();
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
|
||||
ecma_value_t parse_status = parser_parse_script (NULL,
|
||||
0,
|
||||
|
||||
@@ -53,14 +53,14 @@ const ecma_error_mapping_t ecma_error_mappings[] =
|
||||
#define ERROR_ELEMENT(TYPE, ID) { TYPE, ID }
|
||||
ERROR_ELEMENT (ECMA_ERROR_COMMON, ECMA_BUILTIN_ID_ERROR_PROTOTYPE),
|
||||
|
||||
#ifndef CONFIG_DISABLE_ERROR_BUILTINS
|
||||
#if ENABLED (JERRY_BUILTIN_ERRORS)
|
||||
ERROR_ELEMENT (ECMA_ERROR_EVAL, ECMA_BUILTIN_ID_EVAL_ERROR_PROTOTYPE),
|
||||
ERROR_ELEMENT (ECMA_ERROR_RANGE, ECMA_BUILTIN_ID_RANGE_ERROR_PROTOTYPE),
|
||||
ERROR_ELEMENT (ECMA_ERROR_REFERENCE, ECMA_BUILTIN_ID_REFERENCE_ERROR_PROTOTYPE),
|
||||
ERROR_ELEMENT (ECMA_ERROR_TYPE, ECMA_BUILTIN_ID_TYPE_ERROR_PROTOTYPE),
|
||||
ERROR_ELEMENT (ECMA_ERROR_URI, ECMA_BUILTIN_ID_URI_ERROR_PROTOTYPE),
|
||||
ERROR_ELEMENT (ECMA_ERROR_SYNTAX, ECMA_BUILTIN_ID_SYNTAX_ERROR_PROTOTYPE),
|
||||
#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */
|
||||
|
||||
#undef ERROR_ELEMENT
|
||||
};
|
||||
@@ -78,7 +78,7 @@ const ecma_error_mapping_t ecma_error_mappings[] =
|
||||
ecma_object_t *
|
||||
ecma_new_standard_error (ecma_standard_error_t error_type) /**< native error type */
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_ERROR_BUILTINS
|
||||
#if ENABLED (JERRY_BUILTIN_ERRORS)
|
||||
ecma_builtin_id_t prototype_id = ECMA_BUILTIN_ID__COUNT;
|
||||
|
||||
switch (error_type)
|
||||
@@ -130,7 +130,7 @@ ecma_new_standard_error (ecma_standard_error_t error_type) /**< native error typ
|
||||
#else
|
||||
JERRY_UNUSED (error_type);
|
||||
ecma_builtin_id_t prototype_id = ECMA_BUILTIN_ID_ERROR_PROTOTYPE;
|
||||
#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */
|
||||
|
||||
ecma_object_t *prototype_obj_p = ecma_builtin_get (prototype_id);
|
||||
|
||||
@@ -290,13 +290,13 @@ ecma_raise_standard_error_with_format (ecma_standard_error_t error_type, /**< er
|
||||
lit_magic_string_id_t class_name = ecma_object_get_class_name (arg_object_p);
|
||||
arg_string_p = ecma_get_magic_string (class_name);
|
||||
}
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
else if (ecma_is_value_symbol (arg_val))
|
||||
{
|
||||
ecma_value_t symbol_desc_value = ecma_get_symbol_descriptive_string (arg_val);
|
||||
arg_string_p = ecma_get_string_from_value (symbol_desc_value);
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
else
|
||||
{
|
||||
ecma_value_t str_val = ecma_op_to_string (arg_val);
|
||||
|
||||
@@ -43,11 +43,11 @@
|
||||
inline bool JERRY_ATTR_ALWAYS_INLINE
|
||||
ecma_is_normal_or_arrow_function (ecma_object_type_t type) /**< object type */
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_ES2015_ARROW_FUNCTION
|
||||
#if ENABLED (JERRY_ES2015_ARROW_FUNCTION)
|
||||
return (type == ECMA_OBJECT_TYPE_FUNCTION || type == ECMA_OBJECT_TYPE_ARROW_FUNCTION);
|
||||
#else /* CONFIG_DISABLE_ES2015_ARROW_FUNCTION */
|
||||
#else /* !ENABLED (JERRY_ES2015_ARROW_FUNCTION) */
|
||||
return (type == ECMA_OBJECT_TYPE_FUNCTION);
|
||||
#endif /* !CONFIG_DISABLE_ES2015_ARROW_FUNCTION */
|
||||
#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */
|
||||
} /* ecma_is_normal_or_arrow_function */
|
||||
|
||||
/**
|
||||
@@ -74,9 +74,9 @@ ecma_op_is_callable (ecma_value_t value) /**< ecma value */
|
||||
ecma_object_type_t type = ecma_get_object_type (obj_p);
|
||||
|
||||
return (type == ECMA_OBJECT_TYPE_FUNCTION
|
||||
#ifndef CONFIG_DISABLE_ES2015_ARROW_FUNCTION
|
||||
#if ENABLED (JERRY_ES2015_ARROW_FUNCTION)
|
||||
|| type == ECMA_OBJECT_TYPE_ARROW_FUNCTION
|
||||
#endif /* !CONFIG_DISABLE_ES2015_ARROW_FUNCTION */
|
||||
#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */
|
||||
|| type == ECMA_OBJECT_TYPE_EXTERNAL_FUNCTION
|
||||
|| type == ECMA_OBJECT_TYPE_BOUND_FUNCTION);
|
||||
} /* ecma_op_is_callable */
|
||||
@@ -186,7 +186,7 @@ ecma_op_create_function_object (ecma_object_t *scope_p, /**< function's scope */
|
||||
return func_p;
|
||||
} /* ecma_op_create_function_object */
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_ARROW_FUNCTION
|
||||
#if ENABLED (JERRY_ES2015_ARROW_FUNCTION)
|
||||
|
||||
/**
|
||||
* Arrow function object creation operation.
|
||||
@@ -239,7 +239,7 @@ ecma_op_create_arrow_function_object (ecma_object_t *scope_p, /**< function's sc
|
||||
return func_p;
|
||||
} /* ecma_op_create_arrow_function_object */
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ES2015_ARROW_FUNCTION */
|
||||
#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */
|
||||
|
||||
/**
|
||||
* External function object creation operation.
|
||||
@@ -296,7 +296,7 @@ ecma_op_function_get_compiled_code (ecma_extended_object_t *function_p) /**< fun
|
||||
#endif /* JERRY_ENABLE_SNAPSHOT_EXEC */
|
||||
} /* ecma_op_function_get_compiled_code */
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_ARROW_FUNCTION
|
||||
#if ENABLED (JERRY_ES2015_ARROW_FUNCTION)
|
||||
|
||||
/**
|
||||
* Get compiled code of an arrow function object.
|
||||
@@ -322,9 +322,9 @@ ecma_op_arrow_function_get_compiled_code (ecma_arrow_function_t *arrow_function_
|
||||
#endif /* JERRY_ENABLE_SNAPSHOT_EXEC */
|
||||
} /* ecma_op_arrow_function_get_compiled_code */
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ES2015_ARROW_FUNCTION */
|
||||
#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
/**
|
||||
* Helper function for implicit class constructors [[HasInstance]] check.
|
||||
*
|
||||
@@ -386,7 +386,7 @@ ecma_op_implicit_class_constructor_has_instance (ecma_object_t *func_obj_p, /**<
|
||||
|
||||
return ECMA_VALUE_FALSE;
|
||||
} /* ecma_op_implicit_class_constructor_has_instance */
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
|
||||
/**
|
||||
* 15.3.5.3 implementation of [[HasInstance]] for Function objects
|
||||
@@ -409,12 +409,12 @@ ecma_op_function_has_instance (ecma_object_t *func_obj_p, /**< Function object *
|
||||
/* 1. 3. */
|
||||
ecma_extended_object_t *ext_function_p = (ecma_extended_object_t *) func_obj_p;
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
if (JERRY_UNLIKELY (ext_function_p->u.bound_function.args_len_or_this == ECMA_VALUE_IMPLICIT_CONSTRUCTOR))
|
||||
{
|
||||
return ecma_op_implicit_class_constructor_has_instance (func_obj_p, value);
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
|
||||
func_obj_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_object_t,
|
||||
ext_function_p->u.bound_function.target_function);
|
||||
@@ -470,12 +470,12 @@ ecma_op_function_has_instance (ecma_object_t *func_obj_p, /**< Function object *
|
||||
} /* ecma_op_function_has_instance */
|
||||
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
/**
|
||||
* Indicates whether the class has been invoked with 'new'.
|
||||
*/
|
||||
#define ECMA_CLASS_CONSTRUCT_FLAG ((uintptr_t) 0x01u)
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
|
||||
/**
|
||||
* Sets the construct flag in the arguments list pointer.
|
||||
@@ -488,9 +488,9 @@ ecma_op_function_set_construct_flag (const ecma_value_t *arguments_list_p) /**<
|
||||
/* Any ecma value list must be aligned to 4 byte. */
|
||||
JERRY_ASSERT ((((uintptr_t) arguments_list_p) & 0x3) == 0);
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
arguments_list_p = (const ecma_value_t *)(((uintptr_t) arguments_list_p) | ECMA_CLASS_CONSTRUCT_FLAG);
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
|
||||
return arguments_list_p;
|
||||
} /* ecma_op_function_set_construct_flag */
|
||||
@@ -503,9 +503,9 @@ ecma_op_function_set_construct_flag (const ecma_value_t *arguments_list_p) /**<
|
||||
static inline const ecma_value_t * JERRY_ATTR_ALWAYS_INLINE
|
||||
ecma_op_function_clear_construct_flag (const ecma_value_t *arguments_list_p) /**< modified arguments list pointer */
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
arguments_list_p = (const ecma_value_t *)(((uintptr_t) arguments_list_p) & ~ECMA_CLASS_CONSTRUCT_FLAG);
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
|
||||
return arguments_list_p;
|
||||
} /* ecma_op_function_clear_construct_flag */
|
||||
@@ -518,15 +518,15 @@ ecma_op_function_clear_construct_flag (const ecma_value_t *arguments_list_p) /**
|
||||
static inline bool JERRY_ATTR_ALWAYS_INLINE
|
||||
ecma_op_function_has_construct_flag (const ecma_value_t *arguments_list_p) /**< modified arguments list pointer */
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
return (((uintptr_t) arguments_list_p) & ECMA_CLASS_CONSTRUCT_FLAG);
|
||||
#else /* CONFIG_DISABLE_ES2015_CLASS */
|
||||
#else /* !ENABLED (JERRY_ES2015_CLASS) */
|
||||
JERRY_UNUSED (arguments_list_p);
|
||||
return false;
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
} /* ecma_op_function_has_construct_flag */
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
/**
|
||||
* Returns the closest declarative lexical enviroment to the super object bound lexical enviroment.
|
||||
*
|
||||
@@ -677,7 +677,7 @@ ecma_op_set_class_prototype (ecma_value_t completion_value, /**< completion_valu
|
||||
JERRY_ASSERT (prototype_obj_p);
|
||||
ECMA_SET_POINTER (completion_obj_p->prototype_or_outer_reference_cp, prototype_obj_p);
|
||||
} /* ecma_op_set_class_prototype */
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
|
||||
/**
|
||||
* [[Call]] implementation for Function objects,
|
||||
@@ -730,14 +730,14 @@ ecma_op_function_call (ecma_object_t *func_obj_p, /**< Function object */
|
||||
|
||||
const ecma_compiled_code_t *bytecode_data_p = ecma_op_function_get_compiled_code (ext_func_p);
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
bool is_class_constructor = (bytecode_data_p->status_flags & CBC_CODE_FLAGS_CONSTRUCTOR) != 0;
|
||||
|
||||
if (is_class_constructor && !ecma_op_function_has_construct_flag (arguments_list_p))
|
||||
{
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Class constructor cannot be invoked without 'new'."));
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
|
||||
bool is_strict = (bytecode_data_p->status_flags & CBC_CODE_FLAGS_STRICT_MODE) != 0;
|
||||
bool is_no_lex_env = (bytecode_data_p->status_flags & CBC_CODE_FLAGS_LEXICAL_ENV_NOT_NEEDED) != 0;
|
||||
@@ -780,12 +780,12 @@ ecma_op_function_call (ecma_object_t *func_obj_p, /**< Function object */
|
||||
arguments_list_len,
|
||||
bytecode_data_p);
|
||||
}
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
if (JERRY_UNLIKELY (is_class_constructor))
|
||||
{
|
||||
ecma_op_set_class_this_binding (local_env_p, this_binding);
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
}
|
||||
|
||||
ecma_value_t ret_value = vm_run (bytecode_data_p,
|
||||
@@ -827,7 +827,7 @@ ecma_op_function_call (ecma_object_t *func_obj_p, /**< Function object */
|
||||
#endif /* JERRY_DEBUGGER */
|
||||
return ret_value;
|
||||
}
|
||||
#ifndef CONFIG_DISABLE_ES2015_ARROW_FUNCTION
|
||||
#if ENABLED (JERRY_ES2015_ARROW_FUNCTION)
|
||||
case ECMA_OBJECT_TYPE_ARROW_FUNCTION:
|
||||
{
|
||||
/* Entering Function Code (ES2015, 9.2.1) */
|
||||
@@ -865,7 +865,7 @@ ecma_op_function_call (ecma_object_t *func_obj_p, /**< Function object */
|
||||
|
||||
return ret_value;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_ARROW_FUNCTION */
|
||||
#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */
|
||||
default:
|
||||
{
|
||||
JERRY_ASSERT (ecma_get_object_type (func_obj_p) == ECMA_OBJECT_TYPE_BOUND_FUNCTION);
|
||||
@@ -891,7 +891,7 @@ ecma_op_function_call (ecma_object_t *func_obj_p, /**< Function object */
|
||||
|
||||
if (!ecma_is_value_integer_number (args_len_or_this))
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
if (JERRY_UNLIKELY (args_len_or_this == ECMA_VALUE_IMPLICIT_CONSTRUCTOR))
|
||||
{
|
||||
if (!ecma_op_function_has_construct_flag (arguments_list_p))
|
||||
@@ -905,11 +905,11 @@ ecma_op_function_call (ecma_object_t *func_obj_p, /**< Function object */
|
||||
}
|
||||
else
|
||||
{
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
this_arg_value = args_len_or_this;
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
|
||||
args_length = 1;
|
||||
}
|
||||
@@ -927,9 +927,9 @@ ecma_op_function_call (ecma_object_t *func_obj_p, /**< Function object */
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
arguments_list_p = ecma_op_function_clear_construct_flag (arguments_list_p);
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
|
||||
JERRY_ASSERT (!ecma_op_function_has_construct_flag (arguments_list_p));
|
||||
args_length--;
|
||||
@@ -1010,12 +1010,12 @@ ecma_op_function_construct (ecma_object_t *func_obj_p, /**< Function object */
|
||||
/* 5. */
|
||||
if (args_length == 1)
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
if (args_len_or_this == ECMA_VALUE_IMPLICIT_CONSTRUCTOR && ecma_is_value_undefined (this_arg_value))
|
||||
{
|
||||
break;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
func_obj_p = target_func_obj_p;
|
||||
continue;
|
||||
}
|
||||
@@ -1044,12 +1044,12 @@ ecma_op_function_construct (ecma_object_t *func_obj_p, /**< Function object */
|
||||
|
||||
ecma_object_type_t type = ecma_get_object_type (func_obj_p);
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_ARROW_FUNCTION
|
||||
#if ENABLED (JERRY_ES2015_ARROW_FUNCTION)
|
||||
if (JERRY_UNLIKELY (type == ECMA_OBJECT_TYPE_ARROW_FUNCTION))
|
||||
{
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Arrow functions have no constructor."));
|
||||
}
|
||||
#endif /* CONFIG_DISABLE_ES2015_ARROW_FUNCTION */
|
||||
#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */
|
||||
|
||||
if (JERRY_UNLIKELY (type == ECMA_OBJECT_TYPE_FUNCTION && ecma_get_object_is_builtin (func_obj_p)))
|
||||
{
|
||||
@@ -1062,12 +1062,12 @@ ecma_op_function_construct (ecma_object_t *func_obj_p, /**< Function object */
|
||||
arguments_list_p,
|
||||
arguments_list_len);
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
if (!ecma_is_value_undefined (this_arg_value) && !ECMA_IS_VALUE_ERROR (ret_value))
|
||||
{
|
||||
ecma_op_set_class_prototype (ret_value, this_arg_value);
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
|
||||
return ret_value;
|
||||
}
|
||||
@@ -1121,7 +1121,7 @@ ecma_op_function_construct (ecma_object_t *func_obj_p, /**< Function object */
|
||||
arguments_list_len);
|
||||
break;
|
||||
}
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
case ECMA_OBJECT_TYPE_BOUND_FUNCTION:
|
||||
{
|
||||
JERRY_ASSERT (!ecma_op_function_has_construct_flag (arguments_list_p));
|
||||
@@ -1143,12 +1143,12 @@ ecma_op_function_construct (ecma_object_t *func_obj_p, /**< Function object */
|
||||
ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Super constructor null is not a constructor."));
|
||||
break;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
default:
|
||||
{
|
||||
JERRY_ASSERT (type == ECMA_OBJECT_TYPE_EXTERNAL_FUNCTION);
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
ecma_extended_object_t *ext_func_obj_p = (ecma_extended_object_t *) func_obj_p;
|
||||
|
||||
if (ext_func_obj_p->u.external_handler_cb == ecma_op_function_implicit_constructor_handler_cb)
|
||||
@@ -1156,7 +1156,7 @@ ecma_op_function_construct (ecma_object_t *func_obj_p, /**< Function object */
|
||||
ret_value = ECMA_VALUE_UNDEFINED;
|
||||
break;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
|
||||
ret_value = ecma_op_function_call (func_obj_p,
|
||||
this_arg_value,
|
||||
@@ -1240,7 +1240,7 @@ ecma_op_function_try_to_lazy_instantiate_property (ecma_object_t *object_p, /**<
|
||||
|| ecma_compare_ecma_string_to_magic_id (property_name_p, LIT_MAGIC_STRING_ARGUMENTS))
|
||||
{
|
||||
const ecma_compiled_code_t *bytecode_data_p;
|
||||
#ifndef CONFIG_DISABLE_ES2015_ARROW_FUNCTION
|
||||
#if ENABLED (JERRY_ES2015_ARROW_FUNCTION)
|
||||
if (ecma_get_object_type (object_p) == ECMA_OBJECT_TYPE_ARROW_FUNCTION)
|
||||
{
|
||||
ecma_arrow_function_t *arrow_func_p = (ecma_arrow_function_t *) object_p;
|
||||
@@ -1248,12 +1248,12 @@ ecma_op_function_try_to_lazy_instantiate_property (ecma_object_t *object_p, /**<
|
||||
}
|
||||
else
|
||||
{
|
||||
#endif /* CONFIG_DISABLE_ES2015_ARROW_FUNCTION */
|
||||
#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */
|
||||
ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) object_p;
|
||||
bytecode_data_p = ecma_op_function_get_compiled_code (ext_func_p);
|
||||
#ifndef CONFIG_DISABLE_ES2015_ARROW_FUNCTION
|
||||
#if ENABLED (JERRY_ES2015_ARROW_FUNCTION)
|
||||
}
|
||||
#endif /* CONFIG_DISABLE_ES2015_ARROW_FUNCTION */
|
||||
#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */
|
||||
|
||||
if (bytecode_data_p->status_flags & CBC_CODE_FLAGS_STRICT_MODE)
|
||||
{
|
||||
@@ -1419,7 +1419,7 @@ ecma_op_function_list_lazy_property_names (ecma_object_t *object_p, /**< functio
|
||||
|
||||
const ecma_compiled_code_t *bytecode_data_p;
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_ARROW_FUNCTION
|
||||
#if ENABLED (JERRY_ES2015_ARROW_FUNCTION)
|
||||
if (ecma_get_object_type (object_p) == ECMA_OBJECT_TYPE_ARROW_FUNCTION)
|
||||
{
|
||||
bytecode_data_p = ecma_op_arrow_function_get_compiled_code ((ecma_arrow_function_t *) object_p);
|
||||
@@ -1428,9 +1428,9 @@ ecma_op_function_list_lazy_property_names (ecma_object_t *object_p, /**< functio
|
||||
{
|
||||
bytecode_data_p = ecma_op_function_get_compiled_code ((ecma_extended_object_t *) object_p);
|
||||
}
|
||||
#else /* CONFIG_DISABLE_ES2015_ARROW_FUNCTION */
|
||||
#else /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */
|
||||
bytecode_data_p = ecma_op_function_get_compiled_code ((ecma_extended_object_t *) object_p);
|
||||
#endif /* !CONFIG_DISABLE_ES2015_ARROW_FUNCTION */
|
||||
#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */
|
||||
|
||||
if (bytecode_data_p->status_flags & CBC_CODE_FLAGS_STRICT_MODE)
|
||||
{
|
||||
|
||||
@@ -34,11 +34,11 @@ bool ecma_is_constructor (ecma_value_t value);
|
||||
ecma_object_t *
|
||||
ecma_op_create_function_object (ecma_object_t *scope_p, const ecma_compiled_code_t *bytecode_data_p);
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_ARROW_FUNCTION
|
||||
#if ENABLED (JERRY_ES2015_ARROW_FUNCTION)
|
||||
ecma_object_t *
|
||||
ecma_op_create_arrow_function_object (ecma_object_t *scope_p, const ecma_compiled_code_t *bytecode_data_p,
|
||||
ecma_value_t this_binding);
|
||||
#endif /* !CONFIG_DISABLE_ES2015_ARROW_FUNCTION */
|
||||
#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */
|
||||
|
||||
ecma_object_t *
|
||||
ecma_op_create_external_function_object (ecma_external_handler_t handler_cb);
|
||||
@@ -46,7 +46,7 @@ ecma_op_create_external_function_object (ecma_external_handler_t handler_cb);
|
||||
const ecma_compiled_code_t *
|
||||
ecma_op_function_get_compiled_code (ecma_extended_object_t *function_p);
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
void
|
||||
ecma_op_set_super_called (ecma_object_t *lex_env_p);
|
||||
|
||||
@@ -67,12 +67,12 @@ ecma_op_function_implicit_constructor_handler_cb (const ecma_value_t function_ob
|
||||
|
||||
void
|
||||
ecma_op_set_class_prototype (ecma_value_t completion_value, ecma_value_t this_arg);
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_ARROW_FUNCTION
|
||||
#if ENABLED (JERRY_ES2015_ARROW_FUNCTION)
|
||||
const ecma_compiled_code_t *
|
||||
ecma_op_arrow_function_get_compiled_code (ecma_arrow_function_t *arrow_function_p);
|
||||
#endif /* !CONFIG_DISABLE_ES2015_ARROW_FUNCTION */
|
||||
#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */
|
||||
|
||||
ecma_value_t
|
||||
ecma_op_function_has_instance (ecma_object_t *func_obj_p, ecma_value_t value);
|
||||
|
||||
@@ -65,12 +65,12 @@ ecma_op_get_value_lex_env_base (ecma_object_t *lex_env_p, /**< lexical environme
|
||||
}
|
||||
break;
|
||||
}
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
case ECMA_LEXICAL_ENVIRONMENT_SUPER_OBJECT_BOUND:
|
||||
{
|
||||
break;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
default:
|
||||
{
|
||||
JERRY_ASSERT (ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND);
|
||||
@@ -213,12 +213,12 @@ ecma_op_put_value_lex_env_base (ecma_object_t *lex_env_p, /**< lexical environme
|
||||
}
|
||||
break;
|
||||
}
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
case ECMA_LEXICAL_ENVIRONMENT_SUPER_OBJECT_BOUND:
|
||||
{
|
||||
break;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
default:
|
||||
{
|
||||
JERRY_ASSERT (ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND);
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_ITERATOR_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
|
||||
/**
|
||||
* Implementation of 'CreateArrayFromList' specialized for iterators
|
||||
*
|
||||
@@ -161,7 +161,7 @@ ecma_op_create_iterator_object (ecma_value_t iterated_value, /**< value from cre
|
||||
return ecma_make_object_value (object_p);
|
||||
} /* ecma_op_create_iterator_object */
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ES2015_ITERATOR_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
|
||||
/**
|
||||
* @}
|
||||
* @}
|
||||
|
||||
@@ -16,9 +16,10 @@
|
||||
#ifndef ECMA_ITERATOR_OBJECT_H
|
||||
#define ECMA_ITERATOR_OBJECT_H
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_ITERATOR_BUILTIN
|
||||
#include "ecma-globals.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
|
||||
|
||||
/** \addtogroup ecma ECMA
|
||||
* @{
|
||||
*
|
||||
@@ -42,7 +43,7 @@ ecma_create_iter_result_object (ecma_value_t value, ecma_value_t done);
|
||||
ecma_value_t
|
||||
ecma_create_array_from_iter_element (ecma_value_t value, ecma_value_t index_value);
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ES2015_ITERATOR_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include "ecma-promise-object.h"
|
||||
#include "jcontext.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
|
||||
/** \addtogroup ecma ECMA
|
||||
* @{
|
||||
@@ -367,4 +367,4 @@ ecma_free_all_enqueued_jobs (void)
|
||||
* @}
|
||||
* @}
|
||||
*/
|
||||
#endif /* !CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#ifndef ECMA_JOB_QUEUE_H
|
||||
#define ECMA_JOB_QUEUE_H
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
|
||||
/** \addtogroup ecma ECMA
|
||||
* @{
|
||||
@@ -52,5 +52,5 @@ ecma_value_t ecma_process_all_enqueued_jobs (void);
|
||||
* @}
|
||||
* @}
|
||||
*/
|
||||
#endif /* !CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
#endif /* !ECMA_JOB_QUEUE_H */
|
||||
|
||||
@@ -68,7 +68,7 @@ ecma_get_global_environment (void)
|
||||
return JERRY_CONTEXT (ecma_global_lex_env_p);
|
||||
} /* ecma_get_global_environment */
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_MODULE_SYSTEM
|
||||
#if ENABLED (JERRY_ES2015_MODULE_SYSTEM)
|
||||
/**
|
||||
* Add the lexenv of the newly imported module to the JERRY_CONTEXT.
|
||||
*/
|
||||
@@ -106,7 +106,7 @@ ecma_module_finalize_lex_envs (void)
|
||||
|
||||
JERRY_CONTEXT (ecma_module_lex_envs_p) = NULL;
|
||||
} /* ecma_module_finalize_lex_envs */
|
||||
#endif /* !CONFIG_DISABLE_ES2015_MODULE_SYSTEM */
|
||||
#endif /* ENABLED (JERRY_ES2015_MODULE_SYSTEM) */
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -34,10 +34,10 @@ void ecma_init_global_lex_env (void);
|
||||
void ecma_finalize_global_lex_env (void);
|
||||
ecma_object_t *ecma_get_global_environment (void);
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_MODULE_SYSTEM
|
||||
#if ENABLED (JERRY_ES2015_MODULE_SYSTEM)
|
||||
void ecma_module_add_lex_env (ecma_object_t *lex_env_p);
|
||||
void ecma_module_finalize_lex_envs (void);
|
||||
#endif /* !CONFIG_DISABLE_ES2015_MODULE_SYSTEM */
|
||||
#endif /* ENABLED (JERRY_ES2015_MODULE_SYSTEM) */
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "ecma-map-object.h"
|
||||
#include "ecma-objects.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_MAP_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_MAP)
|
||||
|
||||
/** \addtogroup ecma ECMA
|
||||
* @{
|
||||
@@ -581,4 +581,4 @@ ecma_op_map_delete (ecma_value_t this_arg, /**< this argument */
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ES2015_MAP_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
#include "ecma-globals.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_MAP_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_MAP)
|
||||
|
||||
/** \addtogroup ecma ECMA
|
||||
* @{
|
||||
@@ -41,6 +41,6 @@ ecma_value_t ecma_op_map_delete (ecma_value_t this_arg, ecma_value_t key_arg);
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ES2015_MAP_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */
|
||||
|
||||
#endif /* !ECMA_MAP_OBJECT_H */
|
||||
|
||||
@@ -48,11 +48,11 @@ ecma_op_create_number_object (ecma_value_t arg) /**< argument passed to the Numb
|
||||
return conv_to_num_completion;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_DISABLE_NUMBER_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_NUMBER)
|
||||
ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_NUMBER_PROTOTYPE);
|
||||
#else /* CONFIG_DISABLE_NUMBER_BUILTIN */
|
||||
#else /* ENABLED (JERRY_BUILTIN_NUMBER) */
|
||||
ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_OBJECT_PROTOTYPE);
|
||||
#endif /* !CONFIG_DISABLE_NUMBER_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_NUMBER) */
|
||||
|
||||
ecma_object_t *object_p = ecma_create_object (prototype_obj_p,
|
||||
sizeof (ecma_extended_object_t),
|
||||
|
||||
@@ -26,9 +26,9 @@
|
||||
#include "ecma-objects-general.h"
|
||||
#include "ecma-objects.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
#include "ecma-typedarray-object.h"
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
|
||||
/** \addtogroup ecma ECMA
|
||||
* @{
|
||||
@@ -135,18 +135,18 @@ ecma_op_object_get_own_property (ecma_object_t *object_p, /**< the object */
|
||||
}
|
||||
break;
|
||||
}
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
case ECMA_OBJECT_TYPE_PSEUDO_ARRAY:
|
||||
{
|
||||
/* ES2015 9.4.5.1 */
|
||||
if (ecma_is_typedarray (ecma_make_object_value (object_p)))
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
if (ecma_prop_name_is_symbol (property_name_p))
|
||||
{
|
||||
break;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
uint32_t array_index = ecma_string_get_array_index (property_name_p);
|
||||
|
||||
@@ -186,7 +186,7 @@ ecma_op_object_get_own_property (ecma_object_t *object_p, /**< the object */
|
||||
|
||||
break;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
default:
|
||||
{
|
||||
break;
|
||||
@@ -210,7 +210,7 @@ ecma_op_object_get_own_property (ecma_object_t *object_p, /**< the object */
|
||||
/* Get length virtual property. */
|
||||
const ecma_compiled_code_t *bytecode_data_p;
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_ARROW_FUNCTION
|
||||
#if ENABLED (JERRY_ES2015_ARROW_FUNCTION)
|
||||
if (type != ECMA_OBJECT_TYPE_ARROW_FUNCTION)
|
||||
{
|
||||
ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) object_p;
|
||||
@@ -221,10 +221,10 @@ ecma_op_object_get_own_property (ecma_object_t *object_p, /**< the object */
|
||||
ecma_arrow_function_t *arrow_func_p = (ecma_arrow_function_t *) object_p;
|
||||
bytecode_data_p = ecma_op_arrow_function_get_compiled_code (arrow_func_p);
|
||||
}
|
||||
#else /* CONFIG_DISABLE_ES2015_ARROW_FUNCTION */
|
||||
#else /* !ENABLED (JERRY_ES2015_ARROW_FUNCTION) */
|
||||
ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) object_p;
|
||||
bytecode_data_p = ecma_op_function_get_compiled_code (ext_func_p);
|
||||
#endif /* !CONFIG_DISABLE_ES2015_ARROW_FUNCTION */
|
||||
#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */
|
||||
|
||||
uint32_t len;
|
||||
if (bytecode_data_p->status_flags & CBC_CODE_FLAGS_UINT16_ARGUMENTS)
|
||||
@@ -479,16 +479,16 @@ ecma_op_object_find_own (ecma_value_t base_value, /**< base value */
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
/* ES2015 9.4.5.4 */
|
||||
if (ecma_is_typedarray (ecma_make_object_value (object_p)))
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
if (ecma_prop_name_is_symbol (property_name_p))
|
||||
{
|
||||
break;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
uint32_t array_index = ecma_string_get_array_index (property_name_p);
|
||||
|
||||
@@ -509,7 +509,7 @@ ecma_op_object_find_own (ecma_value_t base_value, /**< base value */
|
||||
|
||||
ecma_deref_ecma_string (num_to_str);
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -534,7 +534,7 @@ ecma_op_object_find_own (ecma_value_t base_value, /**< base value */
|
||||
/* Get length virtual property. */
|
||||
const ecma_compiled_code_t *bytecode_data_p;
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_ARROW_FUNCTION
|
||||
#if ENABLED (JERRY_ES2015_ARROW_FUNCTION)
|
||||
if (type != ECMA_OBJECT_TYPE_ARROW_FUNCTION)
|
||||
{
|
||||
ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) object_p;
|
||||
@@ -545,10 +545,10 @@ ecma_op_object_find_own (ecma_value_t base_value, /**< base value */
|
||||
ecma_arrow_function_t *arrow_func_p = (ecma_arrow_function_t *) object_p;
|
||||
bytecode_data_p = ecma_op_arrow_function_get_compiled_code (arrow_func_p);
|
||||
}
|
||||
#else /* CONFIG_DISABLE_ES2015_ARROW_FUNCTION */
|
||||
#else /* !ENABLED (JERRY_ES2015_ARROW_FUNCTION) */
|
||||
ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) object_p;
|
||||
bytecode_data_p = ecma_op_function_get_compiled_code (ext_func_p);
|
||||
#endif /* !CONFIG_DISABLE_ES2015_ARROW_FUNCTION */
|
||||
#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */
|
||||
|
||||
uint32_t len;
|
||||
if (bytecode_data_p->status_flags & CBC_CODE_FLAGS_UINT16_ARGUMENTS)
|
||||
@@ -734,7 +734,7 @@ ecma_op_object_get_by_magic_id (ecma_object_t *object_p, /**< the object */
|
||||
return ecma_op_object_get (object_p, ecma_get_magic_string (property_id));
|
||||
} /* ecma_op_object_get_by_magic_id */
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
/**
|
||||
* [[Get]] operation of ecma object where the property is a well-known symbol
|
||||
*
|
||||
@@ -756,7 +756,7 @@ ecma_op_object_get_by_symbol_id (ecma_object_t *object_p, /**< the object */
|
||||
|
||||
return ret_value;
|
||||
} /* ecma_op_object_get_by_symbol_id */
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
/**
|
||||
* [[Put]] ecma general object's operation
|
||||
@@ -834,16 +834,16 @@ ecma_op_object_put (ecma_object_t *object_p, /**< the object */
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
/* ES2015 9.4.5.5 */
|
||||
if (ecma_is_typedarray (ecma_make_object_value (object_p)))
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
if (ecma_prop_name_is_symbol (property_name_p))
|
||||
{
|
||||
break;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
uint32_t array_index = ecma_string_get_array_index (property_name_p);
|
||||
|
||||
@@ -871,7 +871,7 @@ ecma_op_object_put (ecma_object_t *object_p, /**< the object */
|
||||
|
||||
ecma_deref_ecma_string (num_to_str);
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -1152,9 +1152,9 @@ ecma_op_object_define_own_property (ecma_object_t *obj_p, /**< the object */
|
||||
case ECMA_OBJECT_TYPE_GENERAL:
|
||||
case ECMA_OBJECT_TYPE_CLASS:
|
||||
case ECMA_OBJECT_TYPE_FUNCTION:
|
||||
#ifndef CONFIG_DISABLE_ES2015_ARROW_FUNCTION
|
||||
#if ENABLED (JERRY_ES2015_ARROW_FUNCTION)
|
||||
case ECMA_OBJECT_TYPE_ARROW_FUNCTION:
|
||||
#endif /* !CONFIG_DISABLE_ES2015_ARROW_FUNCTION */
|
||||
#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */
|
||||
case ECMA_OBJECT_TYPE_EXTERNAL_FUNCTION:
|
||||
case ECMA_OBJECT_TYPE_BOUND_FUNCTION:
|
||||
{
|
||||
@@ -1178,22 +1178,22 @@ ecma_op_object_define_own_property (ecma_object_t *obj_p, /**< the object */
|
||||
|
||||
ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) obj_p;
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
if (ext_object_p->u.pseudo_array.type == ECMA_PSEUDO_ARRAY_ARGUMENTS)
|
||||
{
|
||||
#else /* CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
JERRY_ASSERT (ext_object_p->u.pseudo_array.type == ECMA_PSEUDO_ARRAY_ARGUMENTS);
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
return ecma_op_arguments_object_define_own_property (obj_p,
|
||||
property_name_p,
|
||||
property_desc_p,
|
||||
is_throw);
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
}
|
||||
/* ES2015 9.4.5.3 */
|
||||
if (ecma_is_typedarray (ecma_make_object_value (obj_p)))
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
if (ecma_prop_name_is_symbol (property_name_p))
|
||||
{
|
||||
return ecma_op_general_object_define_own_property (obj_p,
|
||||
@@ -1201,7 +1201,7 @@ ecma_op_object_define_own_property (ecma_object_t *obj_p, /**< the object */
|
||||
property_desc_p,
|
||||
is_throw);
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
uint32_t array_index = ecma_string_get_array_index (property_name_p);
|
||||
|
||||
if (array_index != ECMA_STRING_NOT_ARRAY_INDEX)
|
||||
@@ -1235,9 +1235,9 @@ ecma_op_object_define_own_property (ecma_object_t *obj_p, /**< the object */
|
||||
property_name_p,
|
||||
property_desc_p,
|
||||
is_throw);
|
||||
#else /* CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
break;
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
}
|
||||
}
|
||||
} /* ecma_op_object_define_own_property */
|
||||
@@ -1405,9 +1405,9 @@ ecma_op_object_get_property_names (ecma_object_t *obj_p, /**< object */
|
||||
const bool is_enumerable_only = (opts & ECMA_LIST_ENUMERABLE) != 0;
|
||||
const bool is_array_indices_only = (opts & ECMA_LIST_ARRAY_INDICES) != 0;
|
||||
const bool is_with_prototype_chain = (opts & ECMA_LIST_PROTOTYPE) != 0;
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
const bool is_symbols_only = (opts & ECMA_LIST_SYMBOLS) != 0;
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
const size_t bitmap_row_size = sizeof (uint32_t) * JERRY_BITSINBYTE;
|
||||
const size_t names_hashes_bitmap_size = ECMA_OBJECT_HASH_BITMAP_SIZE / bitmap_row_size;
|
||||
@@ -1425,10 +1425,10 @@ ecma_op_object_get_property_names (ecma_object_t *obj_p, /**< object */
|
||||
|
||||
ecma_collection_header_t *prop_names_p = ecma_new_values_collection ();
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
if (JERRY_LIKELY (!is_symbols_only))
|
||||
{
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
if (obj_is_builtin)
|
||||
{
|
||||
@@ -1443,18 +1443,18 @@ ecma_op_object_get_property_names (ecma_object_t *obj_p, /**< object */
|
||||
{
|
||||
case ECMA_OBJECT_TYPE_PSEUDO_ARRAY:
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
if (ecma_is_typedarray (ecma_make_object_value (obj_p)))
|
||||
{
|
||||
ecma_op_typedarray_list_lazy_property_names (obj_p, prop_names_p);
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
break;
|
||||
}
|
||||
case ECMA_OBJECT_TYPE_FUNCTION:
|
||||
#ifndef CONFIG_DISABLE_ES2015_ARROW_FUNCTION
|
||||
#if ENABLED (JERRY_ES2015_ARROW_FUNCTION)
|
||||
case ECMA_OBJECT_TYPE_ARROW_FUNCTION:
|
||||
#endif /* !CONFIG_DISABLE_ES2015_ARROW_FUNCTION */
|
||||
#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */
|
||||
{
|
||||
ecma_op_function_list_lazy_property_names (obj_p,
|
||||
is_enumerable_only,
|
||||
@@ -1506,9 +1506,9 @@ ecma_op_object_get_property_names (ecma_object_t *obj_p, /**< object */
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
ecma_value_t *ecma_value_p = ecma_collection_iterator_init (prop_names_p);
|
||||
|
||||
@@ -1520,10 +1520,10 @@ ecma_op_object_get_property_names (ecma_object_t *obj_p, /**< object */
|
||||
{
|
||||
ecma_string_t *name_p = ecma_get_string_from_value (*ecma_value_p);
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
/* Symbols are never lazy listed */
|
||||
JERRY_ASSERT (!ecma_prop_name_is_symbol (name_p));
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
ecma_value_p = ecma_collection_iterator_next (ecma_value_p);
|
||||
|
||||
@@ -1571,7 +1571,7 @@ ecma_op_object_get_property_names (ecma_object_t *obj_p, /**< object */
|
||||
|
||||
if (!(is_enumerable_only && !ecma_is_property_enumerable (*property_p)))
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
/* If is_symbols_only is false and prop_name is symbol
|
||||
we should skip the current property e.g. for-in.
|
||||
|
||||
@@ -1582,7 +1582,7 @@ ecma_op_object_get_property_names (ecma_object_t *obj_p, /**< object */
|
||||
ecma_deref_ecma_string (name_p);
|
||||
continue;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
uint8_t hash = (uint8_t) ecma_string_hash (name_p);
|
||||
uint32_t bitmap_row = (uint32_t) (hash / bitmap_row_size);
|
||||
@@ -1813,10 +1813,10 @@ ecma_object_check_class_name_is_object (ecma_object_t *obj_p) /**< object */
|
||||
{
|
||||
#ifndef JERRY_NDEBUG
|
||||
return (ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_GLOBAL)
|
||||
#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_PROMISE_PROTOTYPE)
|
||||
#endif /* !CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_ARRAYBUFFER_PROTOTYPE)
|
||||
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_TYPEDARRAY_PROTOTYPE)
|
||||
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_INT8ARRAY_PROTOTYPE)
|
||||
@@ -1827,20 +1827,20 @@ ecma_object_check_class_name_is_object (ecma_object_t *obj_p) /**< object */
|
||||
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_UINT32ARRAY_PROTOTYPE)
|
||||
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_FLOAT32ARRAY_PROTOTYPE)
|
||||
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_UINT8CLAMPEDARRAY_PROTOTYPE)
|
||||
#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64
|
||||
#if ENABLED (JERRY_NUMBER_TYPE_FLOAT64)
|
||||
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_FLOAT64ARRAY_PROTOTYPE)
|
||||
#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 */
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#ifndef CONFIG_DISABLE_ES2015_ITERATOR_BUILTIN
|
||||
#endif /* ENABLED (JERRY_NUMBER_TYPE_FLOAT64) */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
|
||||
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_ARRAY_ITERATOR_PROTOTYPE)
|
||||
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_ITERATOR_PROTOTYPE)
|
||||
#endif /* !CONFIG_DISABLE_ES2015_ITERATOR_BUILTIN */
|
||||
#ifndef CONFIG_DISABLE_ES2015_MAP_BUILTIN
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_MAP)
|
||||
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_MAP_PROTOTYPE)
|
||||
#endif /* !CONFIG_DISABLE_ES2015_MAP_BUILTIN */
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_SYMBOL_PROTOTYPE)
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_OBJECT_PROTOTYPE));
|
||||
#else /* JERRY_NDEBUG */
|
||||
JERRY_UNUSED (obj_p);
|
||||
@@ -1875,19 +1875,19 @@ ecma_object_get_class_name (ecma_object_t *obj_p) /**< object */
|
||||
|
||||
switch (ext_obj_p->u.pseudo_array.type)
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
case ECMA_PSEUDO_ARRAY_TYPEDARRAY:
|
||||
case ECMA_PSEUDO_ARRAY_TYPEDARRAY_WITH_INFO:
|
||||
{
|
||||
return (lit_magic_string_id_t) ext_obj_p->u.pseudo_array.u1.class_id;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#ifndef CONFIG_DISABLE_ES2015_ITERATOR_BUILTIN
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
|
||||
case ECMA_PSEUDO_ARRAY_ITERATOR:
|
||||
{
|
||||
return LIT_MAGIC_STRING_ARRAY_ITERATOR_UL;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_ITERATOR_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
|
||||
default:
|
||||
{
|
||||
JERRY_ASSERT (ext_obj_p->u.pseudo_array.type == ECMA_PSEUDO_ARRAY_ARGUMENTS);
|
||||
@@ -1899,9 +1899,9 @@ ecma_object_get_class_name (ecma_object_t *obj_p) /**< object */
|
||||
break;
|
||||
}
|
||||
case ECMA_OBJECT_TYPE_FUNCTION:
|
||||
#ifndef CONFIG_DISABLE_ES2015_ARROW_FUNCTION
|
||||
#if ENABLED (JERRY_ES2015_ARROW_FUNCTION)
|
||||
case ECMA_OBJECT_TYPE_ARROW_FUNCTION:
|
||||
#endif /* !CONFIG_DISABLE_ES2015_ARROW_FUNCTION */
|
||||
#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */
|
||||
case ECMA_OBJECT_TYPE_EXTERNAL_FUNCTION:
|
||||
case ECMA_OBJECT_TYPE_BOUND_FUNCTION:
|
||||
{
|
||||
@@ -1917,26 +1917,26 @@ ecma_object_get_class_name (ecma_object_t *obj_p) /**< object */
|
||||
|
||||
switch (ext_obj_p->u.built_in.id)
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_MATH_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_MATH)
|
||||
case ECMA_BUILTIN_ID_MATH:
|
||||
{
|
||||
return LIT_MAGIC_STRING_MATH_UL;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_MATH_BUILTIN */
|
||||
#ifndef CONFIG_DISABLE_JSON_BUILTIN
|
||||
#endif /* ENABLED (JERRY_BUILTIN_MATH) */
|
||||
#if ENABLED (JERRY_BUILTIN_JSON)
|
||||
case ECMA_BUILTIN_ID_JSON:
|
||||
{
|
||||
return LIT_MAGIC_STRING_JSON_U;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_JSON_BUILTIN */
|
||||
#ifndef CONFIG_DISABLE_ERROR_BUILTINS
|
||||
#endif /* ENABLED (JERRY_BUILTIN_JSON) */
|
||||
#if ENABLED (JERRY_BUILTIN_ERRORS)
|
||||
case ECMA_BUILTIN_ID_EVAL_ERROR_PROTOTYPE:
|
||||
case ECMA_BUILTIN_ID_RANGE_ERROR_PROTOTYPE:
|
||||
case ECMA_BUILTIN_ID_REFERENCE_ERROR_PROTOTYPE:
|
||||
case ECMA_BUILTIN_ID_SYNTAX_ERROR_PROTOTYPE:
|
||||
case ECMA_BUILTIN_ID_TYPE_ERROR_PROTOTYPE:
|
||||
case ECMA_BUILTIN_ID_URI_ERROR_PROTOTYPE:
|
||||
#endif /* !CONFIG_DISABLE_ERROR_BUILTINS */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_ERRORS) */
|
||||
case ECMA_BUILTIN_ID_ERROR_PROTOTYPE:
|
||||
{
|
||||
return LIT_MAGIC_STRING_ERROR_UL;
|
||||
|
||||
@@ -35,9 +35,9 @@ ecma_value_t ecma_op_object_find (ecma_object_t *object_p, ecma_string_t *proper
|
||||
ecma_value_t ecma_op_object_get_own_data_prop (ecma_object_t *object_p, ecma_string_t *property_name_p);
|
||||
ecma_value_t ecma_op_object_get (ecma_object_t *object_p, ecma_string_t *property_name_p);
|
||||
ecma_value_t ecma_op_object_get_by_magic_id (ecma_object_t *object_p, lit_magic_string_id_t property_id);
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
ecma_value_t ecma_op_object_get_by_symbol_id (ecma_object_t *object_p, lit_magic_string_id_t property_id);
|
||||
#endif /* CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
ecma_value_t ecma_op_object_put (ecma_object_t *object_p, ecma_string_t *property_name_p, ecma_value_t value,
|
||||
bool is_throw);
|
||||
ecma_value_t ecma_op_object_delete (ecma_object_t *obj_p, ecma_string_t *property_name_p, bool is_throw);
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include "ecma-promise-object.h"
|
||||
#include "jcontext.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
|
||||
/** \addtogroup ecma ECMA
|
||||
* @{
|
||||
@@ -778,4 +778,4 @@ ecma_promise_then (ecma_value_t promise, /**< the promise which call 'then' */
|
||||
* @}
|
||||
* @}
|
||||
*/
|
||||
#endif /* !CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#ifndef ECMA_PROMISE_OBJECT_H
|
||||
#define ECMA_PROMISE_OBJECT_H
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
#include "ecma-globals.h"
|
||||
|
||||
/** \addtogroup ecma ECMA
|
||||
@@ -85,5 +85,5 @@ void ecma_promise_free_resolving_functions (ecma_promise_resolving_functions_t *
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
|
||||
#endif /* !ECMA_PROMISE_OBJECT_H */
|
||||
|
||||
@@ -48,13 +48,13 @@ ecma_op_resolve_reference_base (ecma_object_t *lex_env_p, /**< starting lexical
|
||||
|
||||
while (lex_env_iter_p != NULL)
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
if (ecma_get_lex_env_type (lex_env_iter_p) == ECMA_LEXICAL_ENVIRONMENT_SUPER_OBJECT_BOUND)
|
||||
{
|
||||
lex_env_iter_p = ecma_get_lex_env_outer_reference (lex_env_iter_p);
|
||||
JERRY_ASSERT (lex_env_iter_p != NULL);
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
|
||||
if (ecma_op_has_binding (lex_env_iter_p, name_p))
|
||||
{
|
||||
@@ -67,7 +67,7 @@ ecma_op_resolve_reference_base (ecma_object_t *lex_env_p, /**< starting lexical
|
||||
return NULL;
|
||||
} /* ecma_op_resolve_reference_base */
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
/**
|
||||
* Resolve super reference.
|
||||
*
|
||||
@@ -88,7 +88,7 @@ ecma_op_resolve_super_reference_value (ecma_object_t *lex_env_p) /**< starting l
|
||||
lex_env_p = ecma_get_lex_env_outer_reference (lex_env_p);
|
||||
}
|
||||
} /* ecma_op_resolve_super_reference_value */
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
|
||||
/**
|
||||
* Resolve value corresponding to reference.
|
||||
@@ -153,11 +153,11 @@ ecma_op_resolve_reference_value (ecma_object_t *lex_env_p, /**< starting lexical
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
JERRY_ASSERT (lex_env_type == ECMA_LEXICAL_ENVIRONMENT_SUPER_OBJECT_BOUND);
|
||||
#else /* CONFIG_DISABLE_ES2015_CLASS */
|
||||
#else /* !ENABLED (JERRY_ES2015_CLASS) */
|
||||
JERRY_UNREACHABLE ();
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
}
|
||||
|
||||
lex_env_p = ecma_get_lex_env_outer_reference (lex_env_p);
|
||||
|
||||
@@ -28,9 +28,9 @@
|
||||
|
||||
ecma_object_t *ecma_op_resolve_reference_base (ecma_object_t *lex_env_p, ecma_string_t *name_p);
|
||||
ecma_value_t ecma_op_resolve_reference_value (ecma_object_t *lex_env_p, ecma_string_t *name_p);
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
ecma_object_t *ecma_op_resolve_super_reference_value (ecma_object_t *lex_env_p);
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include "lit-char-helpers.h"
|
||||
#include "re-compiler.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_REGEXP)
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@@ -1494,4 +1494,4 @@ ecma_regexp_read_pattern_str_helper (ecma_value_t pattern_arg, /**< the RegExp p
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#ifndef ECMA_REGEXP_OBJECT_H
|
||||
#define ECMA_REGEXP_OBJECT_H
|
||||
|
||||
#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_REGEXP)
|
||||
|
||||
#include "ecma-globals.h"
|
||||
#include "re-compiler.h"
|
||||
@@ -112,5 +112,5 @@ void re_initialize_props (ecma_object_t *re_obj_p, ecma_string_t *source_p, uint
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
#endif /* !ECMA_REGEXP_OBJECT_H */
|
||||
|
||||
@@ -60,11 +60,11 @@ ecma_op_create_string_object (const ecma_value_t *arguments_list_p, /**< list of
|
||||
JERRY_ASSERT (ecma_is_value_string (prim_value));
|
||||
}
|
||||
|
||||
#ifndef CONFIG_DISABLE_STRING_BUILTIN
|
||||
#if ENABLED (JERRY_BUILTIN_STRING)
|
||||
ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_STRING_PROTOTYPE);
|
||||
#else /* CONFIG_DISABLE_STRING_BUILTIN */
|
||||
#else /* !ENABLED (JERRY_BUILTIN_STRING) */
|
||||
ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_OBJECT_PROTOTYPE);
|
||||
#endif /* !CONFIG_DISABLE_STRING_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_BUILTIN_STRING) */
|
||||
|
||||
ecma_object_t *object_p = ecma_create_object (prototype_obj_p,
|
||||
sizeof (ecma_extended_object_t),
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "ecma-objects-general.h"
|
||||
#include "ecma-symbol-object.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
|
||||
/** \addtogroup ecma ECMA
|
||||
* @{
|
||||
@@ -83,11 +83,11 @@ ecma_op_create_symbol_object (const ecma_value_t value) /**< symbol value */
|
||||
{
|
||||
JERRY_ASSERT (ecma_is_value_symbol (value));
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_SYMBOL_PROTOTYPE);
|
||||
#else /* CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#else /* !ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_OBJECT_PROTOTYPE);
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
ecma_object_t *object_p = ecma_create_object (prototype_obj_p,
|
||||
sizeof (ecma_extended_object_t),
|
||||
@@ -178,7 +178,7 @@ ecma_symbol_to_string_helper (ecma_value_t this_arg, /**< this argument value */
|
||||
return ecma_raise_type_error (ECMA_ERR_MSG ("Argument 'this' is must be a Symbol."));
|
||||
} /* ecma_symbol_to_string_helper */
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#ifndef ECMA_SYMBOL_H
|
||||
#define ECMA_SYMBOL_H
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_SYMBOL)
|
||||
#include "ecma-globals.h"
|
||||
|
||||
/** \addtogroup ecma ECMA
|
||||
@@ -44,7 +44,7 @@ ecma_symbol_to_string_helper (ecma_value_t this_arg, bool is_to_string);
|
||||
ecma_value_t
|
||||
ecma_get_symbol_descriptive_string (ecma_value_t symbol_value);
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ES2015_SYMBOL_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SYMBOL) */
|
||||
/**
|
||||
* @}
|
||||
* @}
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "ecma-helpers.h"
|
||||
#include "jcontext.h"
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
|
||||
/** \addtogroup ecma ECMA
|
||||
* @{
|
||||
@@ -85,12 +85,12 @@ ecma_get_typedarray_element (lit_utf8_byte_t *src, /**< the location in the inte
|
||||
{
|
||||
return GET_ELEMENT (float, src);
|
||||
}
|
||||
#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64
|
||||
#if ENABLED (JERRY_NUMBER_TYPE_FLOAT64)
|
||||
case LIT_MAGIC_STRING_FLOAT64_ARRAY_UL:
|
||||
{
|
||||
return GET_ELEMENT (double, src);
|
||||
}
|
||||
#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 */
|
||||
#endif /* ENABLED (JERRY_NUMBER_TYPE_FLOAT64) */
|
||||
default:
|
||||
{
|
||||
JERRY_UNREACHABLE ();
|
||||
@@ -140,13 +140,13 @@ ecma_set_typedarray_element (lit_utf8_byte_t *dst_p, /**< the location in the in
|
||||
*((float *) dst_p) = (float) value;
|
||||
return;
|
||||
}
|
||||
#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64
|
||||
#if ENABLED (JERRY_NUMBER_TYPE_FLOAT64)
|
||||
case LIT_MAGIC_STRING_FLOAT64_ARRAY_UL:
|
||||
{
|
||||
*((double *) dst_p) = (double) value;
|
||||
return;
|
||||
}
|
||||
#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 */
|
||||
#endif /* ENABLED (JERRY_NUMBER_TYPE_FLOAT64) */
|
||||
default:
|
||||
{
|
||||
break;
|
||||
@@ -970,21 +970,21 @@ ecma_op_create_typedarray_with_type_and_length (ecma_object_t *obj_p, /**< Typed
|
||||
element_size_shift = 2;
|
||||
break;
|
||||
}
|
||||
#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64
|
||||
#if ENABLED (JERRY_NUMBER_TYPE_FLOAT64)
|
||||
case LIT_MAGIC_STRING_FLOAT64_ARRAY_UL:
|
||||
{
|
||||
proto_p = ecma_builtin_get (ECMA_BUILTIN_ID_FLOAT64ARRAY_PROTOTYPE);
|
||||
element_size_shift = 3;
|
||||
break;
|
||||
}
|
||||
#endif /* CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64 */
|
||||
#endif /* ENABLED (JERRY_NUMBER_TYPE_FLOAT64) */
|
||||
default:
|
||||
{
|
||||
JERRY_UNREACHABLE ();
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
ecma_value_t constructor_value = ecma_op_object_get_by_magic_id (obj_p, LIT_MAGIC_STRING_CONSTRUCTOR);
|
||||
|
||||
if (ECMA_IS_VALUE_ERROR (constructor_value)
|
||||
@@ -1005,20 +1005,20 @@ ecma_op_create_typedarray_with_type_and_length (ecma_object_t *obj_p, /**< Typed
|
||||
{
|
||||
return constructor_prototype;
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
|
||||
ecma_value_t new_obj = ecma_typedarray_create_object_with_length (array_length,
|
||||
proto_p,
|
||||
element_size_shift,
|
||||
class_id);
|
||||
|
||||
#ifndef CONFIG_DISABLE_ES2015_CLASS
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
ecma_object_t *constructor_prototype_object_p = ecma_get_object_from_value (constructor_prototype);
|
||||
ecma_object_t *new_obj_p = ecma_get_object_from_value (new_obj);
|
||||
ECMA_SET_POINTER (new_obj_p->prototype_or_outer_reference_cp, constructor_prototype_object_p);
|
||||
|
||||
ecma_deref_object (constructor_prototype_object_p);
|
||||
#endif /* !CONFIG_DISABLE_ES2015_CLASS */
|
||||
#endif /* ENABLED (JERRY_ES2015_CLASS) */
|
||||
|
||||
return new_obj;
|
||||
} /* ecma_op_create_typedarray_with_type_and_length */
|
||||
@@ -1027,4 +1027,4 @@ ecma_op_create_typedarray_with_type_and_length (ecma_object_t *obj_p, /**< Typed
|
||||
* @}
|
||||
* @}
|
||||
*/
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
|
||||
@@ -15,10 +15,11 @@
|
||||
|
||||
#ifndef ECMA_TYPEDARRAY_OBJECT_H
|
||||
#define ECMA_TYPEDARRAY_OBJECT_H
|
||||
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|
||||
|
||||
#include "ecma-globals.h"
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
|
||||
/** \addtogroup ecma ECMA
|
||||
* @{
|
||||
*
|
||||
@@ -67,5 +68,5 @@ ecma_value_t ecma_typedarray_create_object_with_length (ecma_length_t array_leng
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
|
||||
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
|
||||
#endif /* !ECMA_TYPEDARRAY_OBJECT_H */
|
||||
|
||||
Reference in New Issue
Block a user