Re-target for ES.Next (#3901)

A list of changes:
- 'es2015-subset' profile is deprecated, and an 'es.next' profile is added.
- The default profile is changed to 'es.next'
- Renamed the JERRY_ES2015 guard to JERRY_ESNEXT
- Renamed JERRY_ES2015_BUILTIN_* guards to JERRY_BUILTIN_*
- Moved es2015 specific tests to a new 'es.next' subdirectory
- Updated docs, targets, and test runners to reflect these changes

Resolves #3737.

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
This commit is contained in:
Dániel Bátyai
2020-06-12 17:55:00 +02:00
committed by GitHub
parent c0270c4887
commit fde0d556ac
832 changed files with 3053 additions and 3046 deletions
@@ -519,12 +519,12 @@ ecma_fast_array_get_property_names (ecma_object_t *object_p, /**< fast access mo
ecma_extended_object_t *ext_obj_p = (ecma_extended_object_t *) object_p;
ecma_collection_t *ret_p = ecma_new_collection ();
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
if (opts & ECMA_LIST_SYMBOLS_ONLY)
{
return ret_p;
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
uint32_t length = ext_obj_p->u.array.length;
@@ -666,7 +666,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 */
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
/**
* Array object creation with custom prototype.
*
@@ -777,7 +777,7 @@ ecma_op_create_array_iterator (ecma_object_t *obj_p, /**< array object */
ECMA_PSEUDO_ARRAY_ITERATOR,
(uint8_t) type);
} /* ecma_op_create_array_iterator */
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/**
* Low level delete of array items from new_length to old_length
@@ -99,7 +99,7 @@ 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);
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
ecma_value_t
ecma_op_array_species_create (ecma_object_t *original_array_p,
ecma_length_t length);
@@ -107,7 +107,7 @@ ecma_op_array_species_create (ecma_object_t *original_array_p,
ecma_value_t
ecma_op_create_array_iterator (ecma_object_t *obj_p,
ecma_array_iterator_type_t type);
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
ecma_value_t
ecma_op_array_object_set_length (ecma_object_t *object_p, ecma_value_t new_value, uint32_t flags);
@@ -24,7 +24,7 @@
#include "ecma-helpers.h"
#include "jmem.h"
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
/** \addtogroup ecma ECMA
* @{
@@ -280,4 +280,4 @@ ecma_arraybuffer_detach (ecma_object_t *object_p) /**< pointer to the ArrayBuffe
* @}
* @}
*/
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
@@ -18,7 +18,7 @@
#include "ecma-globals.h"
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
/** \addtogroup ecma ECMA
* @{
@@ -57,5 +57,5 @@ ecma_is_arraybuffer (ecma_value_t val);
* @}
*/
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
#endif /* !ECMA_ARRAYBUFFER_OBJECT_H */
+6 -6
View File
@@ -130,12 +130,12 @@ ecma_op_abstract_equality_compare (ecma_value_t x, /**< first operand */
y = tmp;
}
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
if (ecma_is_value_symbol (x))
{
return ECMA_VALUE_FALSE;
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
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)
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
|| ecma_is_value_symbol (y)
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
|| 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)
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
|| ecma_is_value_symbol (x)
|| ecma_is_value_symbol (y)
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
|| ecma_is_value_object (x)
|| ecma_is_value_object (y))
{
@@ -26,7 +26,7 @@
#include "ecma-property-hashmap.h"
#include "ecma-objects.h"
#if ENABLED (JERRY_ES2015_BUILTIN_CONTAINER)
#if ENABLED (JERRY_BUILTIN_CONTAINER)
/** \addtogroup ecma ECMA
* @{
@@ -184,7 +184,7 @@ ecma_op_container_entry_size (lit_magic_string_id_t lit_id) /**< class id */
return ECMA_CONTAINER_VALUE_SIZE;
} /* ecma_op_container_entry_size */
#if ENABLED (JERRY_ES2015_BUILTIN_WEAKSET)
#if ENABLED (JERRY_BUILTIN_WEAKSET)
/**
* Release the entries in the WeakSet container.
*/
@@ -213,9 +213,9 @@ ecma_op_container_free_weakset_entries (ecma_object_t *object_p, /**< object poi
*entry_p = ECMA_VALUE_EMPTY;
}
} /* ecma_op_container_free_weakset_entries */
#endif /* ENABLED (JERRY_ES2015_BUILTIN_WEAKSET) */
#endif /* ENABLED (JERRY_BUILTIN_WEAKSET) */
#if ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP)
#if ENABLED (JERRY_BUILTIN_WEAKMAP)
/**
* Release the entries in the WeakMap container.
*/
@@ -247,9 +247,9 @@ ecma_op_container_free_weakmap_entries (ecma_object_t *object_p, /**< object poi
entry_p->value = ECMA_VALUE_EMPTY;
}
} /* ecma_op_container_free_weakmap_entries */
#endif /* ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP) */
#endif /* ENABLED (JERRY_BUILTIN_WEAKMAP) */
#if ENABLED (JERRY_ES2015_BUILTIN_SET)
#if ENABLED (JERRY_BUILTIN_SET)
/**
* Release the entries in the Set container.
*/
@@ -274,9 +274,9 @@ ecma_op_container_free_set_entries (ecma_collection_t *container_p)
*entry_p = ECMA_VALUE_EMPTY;
}
} /* ecma_op_container_free_set_entries */
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SET) */
#endif /* ENABLED (JERRY_BUILTIN_SET) */
#if ENABLED (JERRY_ES2015_BUILTIN_MAP)
#if ENABLED (JERRY_BUILTIN_MAP)
/**
* Release the entries in the Map container.
*/
@@ -304,7 +304,7 @@ ecma_op_container_free_map_entries (ecma_collection_t *container_p)
entry_p->value = ECMA_VALUE_EMPTY;
}
} /* ecma_op_container_free_map_entries */
#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */
#endif /* ENABLED (JERRY_BUILTIN_MAP) */
/**
* Release the internal buffer and the stored entries.
@@ -320,34 +320,34 @@ ecma_op_container_free_entries (ecma_object_t *object_p) /**< collection object
switch (map_object_p->u.class_prop.class_id)
{
#if ENABLED (JERRY_ES2015_BUILTIN_WEAKSET)
#if ENABLED (JERRY_BUILTIN_WEAKSET)
case LIT_MAGIC_STRING_WEAKSET_UL:
{
ecma_op_container_free_weakset_entries (object_p, container_p);
break;
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_WEAKSET) */
#if ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP)
#endif /* ENABLED (JERRY_BUILTIN_WEAKSET) */
#if ENABLED (JERRY_BUILTIN_WEAKMAP)
case LIT_MAGIC_STRING_WEAKMAP_UL:
{
ecma_op_container_free_weakmap_entries (object_p, container_p);
break;
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP) */
#if ENABLED (JERRY_ES2015_BUILTIN_SET)
#endif /* ENABLED (JERRY_BUILTIN_WEAKMAP) */
#if ENABLED (JERRY_BUILTIN_SET)
case LIT_MAGIC_STRING_SET_UL:
{
ecma_op_container_free_set_entries (container_p);
break;
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SET) */
#if ENABLED (JERRY_ES2015_BUILTIN_MAP)
#endif /* ENABLED (JERRY_BUILTIN_SET) */
#if ENABLED (JERRY_BUILTIN_MAP)
case LIT_MAGIC_STRING_MAP_UL:
{
ecma_op_container_free_map_entries (container_p);
break;
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */
#endif /* ENABLED (JERRY_BUILTIN_MAP) */
default:
{
break;
@@ -401,7 +401,7 @@ ecma_op_container_create (const ecma_value_t *arguments_list_p, /**< arguments l
ecma_value_t set_value = ecma_make_object_value (object_p);
ecma_value_t result = set_value;
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
if (arguments_list_len == 0)
{
return result;
@@ -542,7 +542,7 @@ cleanup_adder:
ecma_deref_object (adder_func_p);
cleanup_object:
ecma_deref_object (object_p);
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
return result;
} /* ecma_op_container_create */
@@ -623,12 +623,12 @@ ecma_op_container_get (ecma_value_t this_arg, /**< this argument */
return ECMA_VALUE_ERROR;
}
#if ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP)
#if ENABLED (JERRY_BUILTIN_WEAKMAP)
if (lit_id == LIT_MAGIC_STRING_WEAKMAP_UL && !ecma_is_value_object (key_arg))
{
return ECMA_VALUE_UNDEFINED;
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP) */
#endif /* ENABLED (JERRY_BUILTIN_WEAKMAP) */
ecma_collection_t *container_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_collection_t,
map_object_p->u.class_prop.u.value);
@@ -669,13 +669,13 @@ ecma_op_container_has (ecma_value_t this_arg, /**< this argument */
ecma_collection_t *container_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_collection_t,
map_object_p->u.class_prop.u.value);
#if ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP) || ENABLED (JERRY_ES2015_BUILTIN_WEAKSET)
#if ENABLED (JERRY_BUILTIN_WEAKMAP) || ENABLED (JERRY_BUILTIN_WEAKSET)
if ((map_object_p->u.class_prop.extra_info & ECMA_CONTAINER_FLAGS_WEAK) != 0
&& !ecma_is_value_object (key_arg))
{
return ECMA_VALUE_FALSE;
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP) || ENABLED (JERRY_ES2015_BUILTIN_WEAKSET) */
#endif /* ENABLED (JERRY_BUILTIN_WEAKMAP) || ENABLED (JERRY_BUILTIN_WEAKSET) */
if (ECMA_CONTAINER_GET_SIZE (container_p) == 0)
{
@@ -778,13 +778,13 @@ ecma_op_container_set (ecma_value_t this_arg, /**< this argument */
ecma_collection_t *container_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_collection_t,
map_object_p->u.class_prop.u.value);
#if ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP) || ENABLED (JERRY_ES2015_BUILTIN_WEAKSET)
#if ENABLED (JERRY_BUILTIN_WEAKMAP) || ENABLED (JERRY_BUILTIN_WEAKSET)
if ((map_object_p->u.class_prop.extra_info & ECMA_CONTAINER_FLAGS_WEAK) != 0
&& !ecma_is_value_object (key_arg))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Key must be an object"));
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP) || ENABLED (JERRY_ES2015_BUILTIN_WEAKSET) */
#endif /* ENABLED (JERRY_BUILTIN_WEAKMAP) || ENABLED (JERRY_BUILTIN_WEAKSET) */
ecma_value_t *entry_p = ecma_op_internal_buffer_find (container_p, key_arg, lit_id);
@@ -795,13 +795,13 @@ ecma_op_container_set (ecma_value_t this_arg, /**< this argument */
value_arg,
lit_id);
#if ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP) || ENABLED (JERRY_ES2015_BUILTIN_WEAKSET)
#if ENABLED (JERRY_BUILTIN_WEAKMAP) || ENABLED (JERRY_BUILTIN_WEAKSET)
if ((map_object_p->u.class_prop.extra_info & ECMA_CONTAINER_FLAGS_WEAK) != 0)
{
ecma_object_t *key_p = ecma_get_object_from_value (key_arg);
ecma_op_container_set_weak (key_p, map_object_p);
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP) || ENABLED (JERRY_ES2015_BUILTIN_WEAKSET) */
#endif /* ENABLED (JERRY_BUILTIN_WEAKMAP) || ENABLED (JERRY_BUILTIN_WEAKSET) */
}
else
{
@@ -1014,7 +1014,7 @@ ecma_op_container_remove_weak_entry (ecma_object_t *object_p, /**< internal cont
ecma_op_internal_buffer_delete (container_p, (ecma_container_pair_t *) entry_p, map_object_p->u.class_prop.class_id);
} /* ecma_op_container_remove_weak_entry */
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
/**
* The Create{Set, Map}Iterator Abstract operation
@@ -1207,11 +1207,11 @@ ecma_op_container_iterator_next (ecma_value_t this_val, /**< this argument */
return ret_value;
} /* ecma_op_container_iterator_next */
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/**
* @}
* @}
*/
#endif /* ENABLED (JERRY_ES2015_BUILTIN_CONTAINER) */
#endif /* ENABLED (JERRY_BUILTIN_CONTAINER) */
@@ -19,7 +19,7 @@
#include "ecma-globals.h"
#include "ecma-builtins.h"
#if ENABLED (JERRY_ES2015_BUILTIN_CONTAINER)
#if ENABLED (JERRY_BUILTIN_CONTAINER)
/** \addtogroup ecma ECMA
* @{
@@ -53,6 +53,6 @@ ecma_value_t ecma_op_container_iterator_next (ecma_value_t this_val, ecma_pseudo
* @}
*/
#endif /* ENABLED (JERRY_ES2015_BUILTIN_CONTAINER) */
#endif /* ENABLED (JERRY_BUILTIN_CONTAINER) */
#endif /* !ECMA_CONTAINER_OBJECT_H */
+20 -20
View File
@@ -129,7 +129,7 @@ ecma_op_same_value (ecma_value_t x, /**< ecma value */
return false;
} /* ecma_op_same_value */
#if ENABLED (JERRY_ES2015_BUILTIN_MAP)
#if ENABLED (JERRY_BUILTIN_MAP)
/**
* SameValueZero operation.
*
@@ -175,7 +175,7 @@ ecma_op_same_value_zero (ecma_value_t x, /**< ecma value */
return ecma_op_same_value (x, y);
} /* ecma_op_same_value_zero */
#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */
#endif /* ENABLED (JERRY_BUILTIN_MAP) */
/**
* ToPrimitive operation.
@@ -280,12 +280,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));
}
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
if (ecma_is_value_symbol (value))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Cannot convert a Symbol value to a number."));
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
if (ecma_is_value_object (value))
{
@@ -381,12 +381,12 @@ ecma_get_number (ecma_value_t value, /**< ecma value*/
return ECMA_VALUE_EMPTY;
}
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
if (ecma_is_value_symbol (value))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Cannot convert a Symbol value to a number."));
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
JERRY_ASSERT (ecma_is_value_boolean (value));
@@ -456,13 +456,13 @@ ecma_op_to_string (ecma_value_t value) /**< ecma value */
{
return ecma_get_magic_string (LIT_MAGIC_STRING_NULL);
}
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
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 /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
JERRY_ASSERT (ecma_is_value_boolean (value));
if (ecma_is_value_true (value))
@@ -484,14 +484,14 @@ ecma_op_to_prop_name (ecma_value_t value) /**< ecma value */
{
ecma_check_value_type_is_spec_defined (value);
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
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 /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
return ecma_op_to_string (value);
} /* ecma_op_to_prop_name */
@@ -522,12 +522,12 @@ ecma_op_to_object (ecma_value_t value) /**< ecma value */
{
return ecma_copy_value (value);
}
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
else if (ecma_is_value_symbol (value))
{
return ecma_op_create_symbol_object (value);
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
else
{
if (ecma_is_value_undefined (value)
@@ -594,11 +594,11 @@ ecma_op_from_property_descriptor (const ecma_property_descriptor_t *src_prop_des
}
else
{
#if !ENABLED (JERRY_ES2015)
#if !ENABLED (JERRY_ESNEXT)
JERRY_ASSERT (src_prop_desc_p->flags & (ECMA_PROP_IS_GET_DEFINED | ECMA_PROP_IS_SET_DEFINED));
#else /* ENABLED (JERRY_ES2015) */
#else /* ENABLED (JERRY_ESNEXT) */
if (src_prop_desc_p->flags & (ECMA_PROP_IS_GET_DEFINED | ECMA_PROP_IS_SET_DEFINED))
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
{
/* a. */
if (src_prop_desc_p->get_p == NULL)
@@ -925,7 +925,7 @@ ecma_op_to_length (ecma_value_t value, /**< ecma value */
return value;
}
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
/* 2 */
ecma_number_t num;
ecma_value_t length_num = ecma_op_to_integer (value, &num);
@@ -953,7 +953,7 @@ ecma_op_to_length (ecma_value_t value, /**< ecma value */
/* 6 */
*length = (uint32_t) num;
return ECMA_VALUE_EMPTY;
#else /* !ENABLED (JERRY_ES2015) */
#else /* !ENABLED (JERRY_ESNEXT) */
/* In the case of ES5, ToLength(ES6) operation is the same as ToUint32(ES5) */
ecma_number_t num;
ecma_value_t to_number = ecma_get_number (value, &num);
@@ -966,10 +966,10 @@ ecma_op_to_length (ecma_value_t value, /**< ecma value */
*length = ecma_number_to_uint32 (num);
return ECMA_VALUE_EMPTY;
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
} /* ecma_op_to_length */
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
/**
* CreateListFromArrayLike operation.
* Different types are not handled yet.
@@ -1031,7 +1031,7 @@ ecma_op_create_list_from_array_like (ecma_value_t arr, /**< array value */
/* 9. */
return list_ptr;
} /* ecma_op_create_list_from_array_like */
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/**
* @}
+4 -4
View File
@@ -39,9 +39,9 @@ typedef enum
ecma_value_t ecma_op_check_object_coercible (ecma_value_t value);
bool ecma_op_same_value (ecma_value_t x, ecma_value_t y);
#if ENABLED (JERRY_ES2015_BUILTIN_MAP)
#if ENABLED (JERRY_BUILTIN_MAP)
bool ecma_op_same_value_zero (ecma_value_t x, ecma_value_t y);
#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */
#endif /* ENABLED (JERRY_BUILTIN_MAP) */
ecma_value_t ecma_op_to_primitive (ecma_value_t value, ecma_preferred_type_hint_t preferred_type);
bool ecma_op_to_boolean (ecma_value_t value);
ecma_value_t ecma_op_to_number (ecma_value_t value);
@@ -51,9 +51,9 @@ ecma_string_t *ecma_op_to_prop_name (ecma_value_t value);
ecma_value_t ecma_op_to_object (ecma_value_t value);
ecma_value_t ecma_op_to_integer (ecma_value_t value, ecma_number_t *number_p);
ecma_value_t ecma_op_to_length (ecma_value_t value, uint32_t *length);
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
ecma_collection_t *ecma_op_create_list_from_array_like (ecma_value_t arr, bool prop_names_only);
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
ecma_object_t *ecma_op_from_property_descriptor (const ecma_property_descriptor_t *src_prop_desc_p);
ecma_value_t ecma_op_to_property_descriptor (ecma_value_t obj_value, ecma_property_descriptor_t *out_prop_desc_p);
@@ -22,7 +22,7 @@
#include "ecma-typedarray-object.h"
#include "ecma-objects.h"
#if ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW)
#if ENABLED (JERRY_BUILTIN_DATAVIEW)
/** \addtogroup ecma ECMA
* @{
@@ -333,4 +333,4 @@ ecma_is_dataview (ecma_value_t value) /**< the target need to be checked */
* @}
*/
#endif /* ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW */
#endif /* ENABLED (JERRY_BUILTIN_DATAVIEW */
@@ -18,7 +18,7 @@
#include "ecma-globals.h"
#if ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW)
#if ENABLED (JERRY_BUILTIN_DATAVIEW)
/** \addtogroup ecma ECMA
* @{
@@ -39,6 +39,6 @@ bool ecma_is_dataview (ecma_value_t value);
* @}
*/
#endif /* ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW */
#endif /* ENABLED (JERRY_BUILTIN_DATAVIEW */
#endif /* !ECMA_DATAVIEW_OBJECT_H */
+2 -2
View File
@@ -97,9 +97,9 @@ 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_RESOURCE_EVAL);
#endif /* ENABLED (JERRY_RESOURCE_NAME) */
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
ECMA_CLEAR_LOCAL_PARSE_OPTS ();
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
ecma_value_t parse_status = parser_parse_script (NULL,
0,
+2 -2
View File
@@ -286,13 +286,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);
}
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
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 /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
else
{
arg_string_p = ecma_op_to_string (arg_val);
@@ -51,7 +51,7 @@ ecma_op_resource_name (const ecma_compiled_code_t *bytecode_header_p)
} /* ecma_op_resource_name */
#endif /* ENABLED (JERRY_RESOURCE_NAME) */
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
/**
* SetFunctionName operation
*
@@ -100,7 +100,7 @@ ecma_op_function_form_name (ecma_string_t *prop_name_p, /**< property name */
return ecma_make_string_value (prop_name_p);
} /* ecma_op_function_form_name */
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/**
* IsCallable operation.
@@ -117,12 +117,12 @@ ecma_op_object_is_callable (ecma_object_t *obj_p) /**< ecma object */
const ecma_object_type_t type = ecma_get_object_type (obj_p);
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
#if ENABLED (JERRY_BUILTIN_PROXY)
if (ECMA_OBJECT_TYPE_IS_PROXY (type))
{
return ecma_op_is_callable (((ecma_proxy_object_t *) obj_p)->target);
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
return type >= ECMA_OBJECT_TYPE_FUNCTION;
} /* ecma_op_object_is_callable */
@@ -165,12 +165,12 @@ ecma_object_is_constructor (ecma_object_t *obj_p) /**< ecma object */
type = ecma_get_object_type (obj_p);
}
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
#if ENABLED (JERRY_BUILTIN_PROXY)
if (ECMA_OBJECT_TYPE_IS_PROXY (type))
{
return ecma_is_constructor (((ecma_proxy_object_t *) obj_p)->target);
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
if (type == ECMA_OBJECT_TYPE_FUNCTION)
{
@@ -384,16 +384,16 @@ ecma_op_create_dynamic_function (const ecma_value_t *arguments_list_p, /**< argu
{
JERRY_ASSERT (ecma_is_value_true (ret_value));
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
ecma_value_t *func_name_p;
func_name_p = ecma_compiled_code_resolve_function_name ((const ecma_compiled_code_t *) bytecode_data_p);
*func_name_p = ecma_make_magic_string_value (LIT_MAGIC_STRING_ANONYMOUS);
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
ecma_object_t *global_env_p = ecma_get_global_environment ();
ecma_builtin_id_t fallback_proto = ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE;
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
ecma_object_t *new_target_p = JERRY_CONTEXT (current_new_target);
bool is_generator_func = parse_opts & ECMA_PARSE_GENERATOR_FUNCTION;
@@ -423,14 +423,14 @@ ecma_op_create_dynamic_function (const ecma_value_t *arguments_list_p, /**< argu
ecma_deref_ecma_string (function_body_str_p);
return ECMA_VALUE_ERROR;
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
ecma_object_t *func_obj_p = ecma_op_create_function_object (global_env_p, bytecode_data_p, fallback_proto);
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
ECMA_SET_NON_NULL_POINTER (func_obj_p->u2.prototype_cp, proto);
ecma_deref_object (proto);
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
ecma_bytecode_deref (bytecode_data_p);
ret_value = ecma_make_object_value (func_obj_p);
@@ -459,7 +459,7 @@ ecma_op_create_simple_function_object (ecma_object_t *scope_p, /**< function's s
return ecma_op_create_function_object (scope_p, bytecode_data_p, ECMA_BUILTIN_ID_FUNCTION_PROTOTYPE);
} /* ecma_op_create_simple_function_object */
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
/**
* GeneratorFunction object creation operation.
@@ -531,7 +531,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 /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/**
* External function object creation operation.
@@ -588,7 +588,7 @@ ecma_op_function_get_compiled_code (ecma_extended_object_t *function_p) /**< fun
#endif /* ENABLED (JERRY_SNAPSHOT_EXEC) */
} /* ecma_op_function_get_compiled_code */
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
/**
* Check whether the given object [[FunctionKind]] internal slot value is "generator".
*
@@ -610,7 +610,7 @@ ecma_op_function_is_generator (ecma_object_t *obj_p) /**< object */
return false;
} /* ecma_op_function_is_generator */
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/**
* 15.3.5.3 implementation of [[HasInstance]] for Function objects
@@ -665,16 +665,16 @@ ecma_op_function_has_instance (ecma_object_t *func_obj_p, /**< Function object *
ecma_object_t *prototype_obj_p = ecma_get_object_from_value (prototype_obj_value);
JERRY_ASSERT (prototype_obj_p != NULL);
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
#if ENABLED (JERRY_BUILTIN_PROXY)
ecma_value_t result = ECMA_VALUE_ERROR;
#else /* !ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
#else /* !ENABLED (JERRY_BUILTIN_PROXY) */
ecma_value_t result = ECMA_VALUE_FALSE;
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
while (true)
{
jmem_cpointer_t v_obj_cp;
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
#if ENABLED (JERRY_BUILTIN_PROXY)
if (ECMA_OBJECT_IS_PROXY (v_obj_p))
{
ecma_value_t parent = ecma_proxy_object_get_prototype_of (v_obj_p);
@@ -688,17 +688,17 @@ ecma_op_function_has_instance (ecma_object_t *func_obj_p, /**< Function object *
}
else
{
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
v_obj_cp = ecma_op_ordinary_object_get_prototype_of (v_obj_p);
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
#if ENABLED (JERRY_BUILTIN_PROXY)
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
if (v_obj_cp == JMEM_CP_NULL)
{
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
#if ENABLED (JERRY_BUILTIN_PROXY)
result = ECMA_VALUE_FALSE;
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
break;
}
@@ -715,7 +715,7 @@ ecma_op_function_has_instance (ecma_object_t *func_obj_p, /**< Function object *
return result;
} /* ecma_op_function_has_instance */
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
/**
* GetSuperConstructor operation for class methods
@@ -730,7 +730,7 @@ ecma_op_function_get_super_constructor (ecma_object_t *func_obj_p) /**< function
{
ecma_object_t *super_ctor_p;
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
#if ENABLED (JERRY_BUILTIN_PROXY)
if (ECMA_OBJECT_IS_PROXY (func_obj_p))
{
ecma_value_t super_ctor = ecma_proxy_object_get_prototype_of (func_obj_p);
@@ -744,7 +744,7 @@ ecma_op_function_get_super_constructor (ecma_object_t *func_obj_p) /**< function
}
else
{
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
jmem_cpointer_t proto_cp = ecma_op_ordinary_object_get_prototype_of (func_obj_p);
if (proto_cp == JMEM_CP_NULL)
{
@@ -755,9 +755,9 @@ ecma_op_function_get_super_constructor (ecma_object_t *func_obj_p) /**< function
super_ctor_p = ECMA_GET_NON_NULL_POINTER (ecma_object_t, proto_cp);
ecma_ref_object (super_ctor_p);
}
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
#if ENABLED (JERRY_BUILTIN_PROXY)
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
if (super_ctor_p == NULL || !ecma_object_is_constructor (super_ctor_p))
{
@@ -770,7 +770,7 @@ ecma_op_function_get_super_constructor (ecma_object_t *func_obj_p) /**< function
return ecma_make_object_value (super_ctor_p);
} /* ecma_op_function_get_super_constructor */
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/**
* Ordinary internal method: GetPrototypeFromConstructor (constructor, intrinsicDefaultProto)
@@ -843,7 +843,7 @@ ecma_op_function_call_simple (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);
uint16_t status_flags = bytecode_data_p->status_flags;
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
bool is_construct_call = JERRY_CONTEXT (current_new_target) != NULL;
if (JERRY_UNLIKELY (status_flags & (CBC_CODE_FLAGS_CLASS_CONSTRUCTOR | CBC_CODE_FLAGS_GENERATOR)))
{
@@ -857,10 +857,10 @@ ecma_op_function_call_simple (ecma_object_t *func_obj_p, /**< Function object */
return ecma_raise_type_error (ECMA_ERR_MSG ("Generator functions cannot be invoked with 'new'."));
}
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/* 1. */
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
ecma_object_t *old_function_object_p = JERRY_CONTEXT (current_function_obj_p);
if (JERRY_UNLIKELY (status_flags & CBC_CODE_FLAGS_ARROW_FUNCTION))
@@ -880,7 +880,7 @@ ecma_op_function_call_simple (ecma_object_t *func_obj_p, /**< Function object */
else
{
JERRY_CONTEXT (current_function_obj_p) = func_obj_p;
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
if (!(status_flags & CBC_CODE_FLAGS_STRICT_MODE))
{
if (ecma_is_value_undefined (this_binding)
@@ -898,9 +898,9 @@ ecma_op_function_call_simple (ecma_object_t *func_obj_p, /**< Function object */
JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (this_binding));
}
}
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/* 5. */
ecma_object_t *local_env_p;
@@ -919,7 +919,7 @@ ecma_op_function_call_simple (ecma_object_t *func_obj_p, /**< Function object */
arguments_list_len,
bytecode_data_p);
}
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
// ECMAScript v6, 9.2.2.8
if (JERRY_UNLIKELY (status_flags & CBC_CODE_FLAGS_CLASS_CONSTRUCTOR))
{
@@ -928,7 +928,7 @@ ecma_op_function_call_simple (ecma_object_t *func_obj_p, /**< Function object */
: this_binding);
ecma_op_init_this_binding (local_env_p, lexical_this);
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
}
ecma_value_t ret_value = vm_run (bytecode_data_p,
@@ -937,7 +937,7 @@ ecma_op_function_call_simple (ecma_object_t *func_obj_p, /**< Function object */
arguments_list_p,
arguments_list_len);
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
JERRY_CONTEXT (current_function_obj_p) = old_function_object_p;
/* ECMAScript v6, 9.2.2.13 */
@@ -957,7 +957,7 @@ ecma_op_function_call_simple (ecma_object_t *func_obj_p, /**< Function object */
}
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
if (!(status_flags & CBC_CODE_FLAGS_LEXICAL_ENV_NOT_NEEDED))
{
@@ -1111,20 +1111,20 @@ ecma_op_function_call (ecma_object_t *func_obj_p, /**< Function object */
const ecma_object_type_t type = ecma_get_object_type (func_obj_p);
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
#if ENABLED (JERRY_BUILTIN_PROXY)
if (ECMA_OBJECT_TYPE_IS_PROXY (type))
{
return ecma_proxy_object_call (func_obj_p, this_arg_value, arguments_list_p, arguments_list_len);
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
ecma_object_t *old_new_target_p = JERRY_CONTEXT (current_new_target);
if (JERRY_UNLIKELY (!(JERRY_CONTEXT (status_flags) & ECMA_STATUS_DIRECT_EVAL)))
{
JERRY_CONTEXT (current_new_target) = NULL;
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
ecma_value_t result;
@@ -1141,9 +1141,9 @@ ecma_op_function_call (ecma_object_t *func_obj_p, /**< Function object */
result = ecma_op_function_call_bound (func_obj_p, arguments_list_p, arguments_list_len);
}
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
JERRY_CONTEXT (current_new_target) = old_new_target_p;
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
return result;
} /* ecma_op_function_call */
@@ -1209,16 +1209,16 @@ ecma_op_function_construct_external (ecma_object_t *func_obj_p, /**< Function ob
ecma_value_t this_arg = ecma_make_object_value (new_this_obj_p);
ecma_deref_object (proto_p);
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
ecma_object_t *old_new_target_p = JERRY_CONTEXT (current_new_target);
JERRY_CONTEXT (current_new_target) = new_target_p;
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
ecma_value_t ret_value = ecma_op_function_call_external (func_obj_p, this_arg, arguments_list_p, arguments_list_len);
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
JERRY_CONTEXT (current_new_target) = old_new_target_p;
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
if (ECMA_IS_VALUE_ERROR (ret_value) || ecma_is_value_object (ret_value))
{
@@ -1250,7 +1250,7 @@ ecma_op_function_construct (ecma_object_t *func_obj_p, /**< Function object */
const ecma_object_type_t type = ecma_get_object_type (func_obj_p);
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
#if ENABLED (JERRY_BUILTIN_PROXY)
if (ECMA_OBJECT_TYPE_IS_PROXY (type))
{
return ecma_proxy_object_construct (func_obj_p,
@@ -1258,7 +1258,7 @@ ecma_op_function_construct (ecma_object_t *func_obj_p, /**< Function object */
arguments_list_p,
arguments_list_len);
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
if (JERRY_UNLIKELY (type == ECMA_OBJECT_TYPE_BOUND_FUNCTION))
{
@@ -1292,7 +1292,7 @@ ecma_op_function_construct (ecma_object_t *func_obj_p, /**< Function object */
return ecma_raise_type_error (ECMA_ERR_MSG ("Expected a constructor."));
}
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
/* 6. */
ecma_object_t *old_new_target_p = JERRY_CONTEXT (current_new_target);
JERRY_CONTEXT (current_new_target) = new_target_p;
@@ -1300,7 +1300,7 @@ ecma_op_function_construct (ecma_object_t *func_obj_p, /**< Function object */
/* 5. */
if (!ECMA_GET_THIRD_BIT_FROM_POINTER_TAG (ext_func_obj_p->u.function.scope_cp))
{
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/* 5.a */
ecma_object_t *proto_p = ecma_op_get_prototype_from_constructor (new_target_p, ECMA_BUILTIN_ID_OBJECT_PROTOTYPE);
@@ -1313,31 +1313,31 @@ ecma_op_function_construct (ecma_object_t *func_obj_p, /**< Function object */
new_this_obj_p = ecma_create_object (proto_p, 0, ECMA_OBJECT_TYPE_GENERAL);
ecma_deref_object (proto_p);
this_arg = ecma_make_object_value (new_this_obj_p);
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
}
else
{
this_arg = ECMA_VALUE_UNDEFINED;
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
ecma_value_t ret_value = ecma_op_function_call_simple (func_obj_p, this_arg, arguments_list_p, arguments_list_len);
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
JERRY_CONTEXT (current_new_target) = old_new_target_p;
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/* 13.a */
if (ECMA_IS_VALUE_ERROR (ret_value) || ecma_is_value_object (ret_value))
{
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
if (new_this_obj_p != NULL)
{
ecma_deref_object (new_this_obj_p);
}
#else /* !ENABLED (JERRY_ES2015) */
#else /* !ENABLED (JERRY_ESNEXT) */
ecma_deref_object (new_this_obj_p);
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
return ret_value;
}
@@ -1362,7 +1362,7 @@ ecma_op_lazy_instantiate_prototype_object (ecma_object_t *object_p) /**< the fun
ecma_object_t *proto_object_p = NULL;
bool init_constructor = true;
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
if (ecma_get_object_type (object_p) == ECMA_OBJECT_TYPE_FUNCTION)
{
const ecma_compiled_code_t *byte_code_p = ecma_op_function_get_compiled_code ((ecma_extended_object_t *) object_p);
@@ -1379,11 +1379,11 @@ ecma_op_lazy_instantiate_prototype_object (ecma_object_t *object_p) /**< the fun
return NULL;
}
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
if (proto_object_p == NULL)
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
{
proto_object_p = ecma_op_create_object_object_noarg ();
}
@@ -1432,7 +1432,7 @@ ecma_op_function_try_to_lazy_instantiate_property (ecma_object_t *object_p, /**<
{
JERRY_ASSERT (!ecma_get_object_is_builtin (object_p));
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
if (ecma_compare_ecma_string_to_magic_id (property_name_p, LIT_MAGIC_STRING_LENGTH))
{
ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) object_p;
@@ -1496,7 +1496,7 @@ ecma_op_function_try_to_lazy_instantiate_property (ecma_object_t *object_p, /**<
return NULL;
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
if (ecma_compare_ecma_string_to_magic_id (property_name_p, LIT_MAGIC_STRING_PROTOTYPE)
&& ecma_get_object_type (object_p) == ECMA_OBJECT_TYPE_FUNCTION)
@@ -1510,7 +1510,7 @@ ecma_op_function_try_to_lazy_instantiate_property (ecma_object_t *object_p, /**<
const ecma_compiled_code_t *bytecode_data_p;
bytecode_data_p = ecma_op_function_get_compiled_code ((ecma_extended_object_t *) object_p);
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
if (!(bytecode_data_p->status_flags & CBC_CODE_FLAGS_STRICT_MODE))
{
ecma_property_t *value_prop_p;
@@ -1522,7 +1522,7 @@ ecma_op_function_try_to_lazy_instantiate_property (ecma_object_t *object_p, /**<
value_p->value = ECMA_VALUE_NULL;
return value_prop_p;
}
#else /* !ENABLED (JERRY_ES2015) */
#else /* !ENABLED (JERRY_ESNEXT) */
if (bytecode_data_p->status_flags & CBC_CODE_FLAGS_STRICT_MODE)
{
ecma_object_t *thrower_p = ecma_builtin_get (ECMA_BUILTIN_ID_TYPE_ERROR_THROWER);
@@ -1537,7 +1537,7 @@ ecma_op_function_try_to_lazy_instantiate_property (ecma_object_t *object_p, /**<
&caller_prop_p);
return caller_prop_p;
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
}
@@ -1595,7 +1595,7 @@ ecma_op_bound_function_try_to_lazy_instantiate_property (ecma_object_t *object_p
args_length = ecma_get_integer_from_value (args_len_or_this);
}
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
if (ECMA_GET_FIRST_BIT_FROM_POINTER_TAG (bound_func_p->header.u.bound_function.target_function))
{
return NULL;
@@ -1606,7 +1606,7 @@ ecma_op_bound_function_try_to_lazy_instantiate_property (ecma_object_t *object_p
/* Set tag bit to represent initialized 'length' property */
ECMA_SET_FIRST_BIT_TO_POINTER_TAG (bound_func_p->header.u.bound_function.target_function);
#else /* !ENABLED (JERRY_ES2015) */
#else /* !ENABLED (JERRY_ESNEXT) */
length_attributes = ECMA_PROPERTY_FIXED;
ecma_object_t *target_func_p;
@@ -1623,7 +1623,7 @@ ecma_op_bound_function_try_to_lazy_instantiate_property (ecma_object_t *object_p
length = ecma_get_integer_from_value (get_len_value) - (args_length - 1);
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
if (length < 0)
{
@@ -1679,36 +1679,36 @@ ecma_op_function_list_lazy_property_names (ecma_object_t *object_p, /**< functio
ecma_collection_t *for_non_enumerable_p = (opts & ECMA_LIST_ENUMERABLE) ? non_enum_collection_p : main_collection_p;
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) object_p;
if (!ECMA_GET_FIRST_BIT_FROM_POINTER_TAG (ext_func_p->u.function.scope_cp))
{
/* Unintialized 'length' property is non-enumerable (ECMA-262 v6, 19.2.4.1) */
ecma_collection_push_back (for_non_enumerable_p, ecma_make_magic_string_value (LIT_MAGIC_STRING_LENGTH));
}
#else /* !ENABLED (JERRY_ES2015) */
#else /* !ENABLED (JERRY_ESNEXT) */
/* 'length' property is non-enumerable (ECMA-262 v5, 13.2.5) */
ecma_collection_push_back (for_non_enumerable_p, ecma_make_magic_string_value (LIT_MAGIC_STRING_LENGTH));
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
const ecma_compiled_code_t *bytecode_data_p;
bytecode_data_p = ecma_op_function_get_compiled_code ((ecma_extended_object_t *) object_p);
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
if (bytecode_data_p->status_flags & (CBC_CODE_FLAGS_ARROW_FUNCTION | CBC_CODE_FLAGS_ACCESSOR))
{
return;
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/* 'prototype' property is non-enumerable (ECMA-262 v5, 13.2.18) */
ecma_collection_push_back (for_non_enumerable_p, ecma_make_magic_string_value (LIT_MAGIC_STRING_PROTOTYPE));
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
bool append_caller_and_arguments = !(bytecode_data_p->status_flags & CBC_CODE_FLAGS_STRICT_MODE);
#else /* !ENABLED (JERRY_ES2015) */
#else /* !ENABLED (JERRY_ESNEXT) */
bool append_caller_and_arguments = (bytecode_data_p->status_flags & CBC_CODE_FLAGS_STRICT_MODE);
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
if (append_caller_and_arguments)
{
@@ -1739,11 +1739,11 @@ ecma_op_external_function_list_lazy_property_names (ecma_object_t *object_p, /**
ecma_collection_t *for_non_enumerable_p = (opts & ECMA_LIST_ENUMERABLE) ? non_enum_collection_p : main_collection_p;
#if !ENABLED (JERRY_ES2015)
#if !ENABLED (JERRY_ESNEXT)
JERRY_UNUSED (object_p);
#else /* ENABLED (JERRY_ES2015) */
#else /* ENABLED (JERRY_ESNEXT) */
if (!ecma_op_ordinary_object_has_own_property (object_p, ecma_get_magic_string (LIT_MAGIC_STRING_PROTOTYPE)))
#endif /* !ENABLED (JERRY_ES2015) */
#endif /* !ENABLED (JERRY_ESNEXT) */
{
/* 'prototype' property is non-enumerable (ECMA-262 v5, 13.2.18) */
ecma_collection_push_back (for_non_enumerable_p, ecma_make_magic_string_value (LIT_MAGIC_STRING_PROTOTYPE));
@@ -1770,18 +1770,18 @@ ecma_op_bound_function_list_lazy_property_names (ecma_object_t *object_p, /**< b
ecma_collection_t *for_non_enumerable_p = (opts & ECMA_LIST_ENUMERABLE) ? non_enum_collection_p : main_collection_p;
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
/* Unintialized 'length' property is non-enumerable (ECMA-262 v6, 19.2.4.1) */
ecma_bound_function_t *bound_func_p = (ecma_bound_function_t *) object_p;
if (!ECMA_GET_FIRST_BIT_FROM_POINTER_TAG (bound_func_p->header.u.bound_function.target_function))
{
ecma_collection_push_back (for_non_enumerable_p, ecma_make_magic_string_value (LIT_MAGIC_STRING_LENGTH));
}
#else /* !ENABLED (JERRY_ES2015) */
#else /* !ENABLED (JERRY_ESNEXT) */
JERRY_UNUSED (object_p);
/* 'length' property is non-enumerable (ECMA-262 v5, 13.2.5) */
ecma_collection_push_back (for_non_enumerable_p, ecma_make_magic_string_value (LIT_MAGIC_STRING_LENGTH));
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/* 'caller' property is non-enumerable (ECMA-262 v5, 13.2.5) */
ecma_collection_push_back (for_non_enumerable_p, ecma_make_magic_string_value (LIT_MAGIC_STRING_CALLER));
@@ -31,9 +31,9 @@
ecma_value_t ecma_op_resource_name (const ecma_compiled_code_t *bytecode_header_p);
#endif /* ENABLED (JERRY_RESOURCE_NAME) */
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
ecma_value_t ecma_op_function_form_name (ecma_string_t *prop_name_p, char *prefix_p, lit_utf8_size_t prefix_size);
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
bool ecma_op_is_callable (ecma_value_t value);
bool ecma_op_object_is_callable (ecma_object_t *obj_p);
@@ -54,7 +54,7 @@ ecma_op_create_dynamic_function (const ecma_value_t *arguments_list_p,
ecma_length_t arguments_list_len,
ecma_parse_opts_t opts);
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
ecma_value_t
ecma_op_function_get_super_constructor (ecma_object_t *func_obj_p);
@@ -66,7 +66,7 @@ ecma_op_create_arrow_function_object (ecma_object_t *scope_p, const ecma_compile
ecma_value_t this_binding);
bool
ecma_op_function_is_generator (ecma_object_t *func_obj_p);
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
ecma_object_t *
ecma_op_get_prototype_from_constructor (ecma_object_t *ctor_obj_p, ecma_builtin_id_t default_proto_id);
+14 -14
View File
@@ -64,24 +64,24 @@ ecma_op_get_value_lex_env_base (ecma_object_t *lex_env_p, /**< lexical environme
*ref_base_lex_env_p = lex_env_p;
ecma_property_value_t *property_value_p = ECMA_PROPERTY_VALUE_PTR (property_p);
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
if (JERRY_UNLIKELY (property_value_p->value == ECMA_VALUE_UNINITIALIZED))
{
return ecma_raise_reference_error (ECMA_ERR_MSG ("Variables declared by let/const must be"
" initialized before reading their value."));
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
return ecma_fast_copy_value (property_value_p->value);
}
break;
}
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
case ECMA_LEXICAL_ENVIRONMENT_HOME_OBJECT_BOUND:
{
break;
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
default:
{
JERRY_ASSERT (ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND);
@@ -168,12 +168,12 @@ ecma_op_get_value_object_base (ecma_value_t base_value, /**< base value */
id = ECMA_BUILTIN_ID_NUMBER_PROTOTYPE;
#endif /* ENABLED (JERRY_BUILTIN_NUMBER) */
}
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
else if (ecma_is_value_symbol (base_value))
{
id = ECMA_BUILTIN_ID_SYMBOL_PROTOTYPE;
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
else
{
JERRY_ASSERT (ecma_is_value_boolean (base_value));
@@ -219,22 +219,22 @@ ecma_op_put_value_lex_env_base (ecma_object_t *lex_env_p, /**< lexical environme
{
ecma_property_value_t *property_value_p = ECMA_PROPERTY_VALUE_PTR (property_p);
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
if (JERRY_UNLIKELY (property_value_p->value == ECMA_VALUE_UNINITIALIZED))
{
return ecma_raise_reference_error (ECMA_ERR_MSG ("Variables declared by let/const must be"
" initialized before writing their value."));
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
ecma_named_data_property_assign_value (lex_env_p, property_value_p, value);
}
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
else if (ecma_is_property_enumerable (*property_p))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Constant bindings cannot be reassigned."));
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
else if (is_strict)
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Binding cannot be set."));
@@ -243,12 +243,12 @@ ecma_op_put_value_lex_env_base (ecma_object_t *lex_env_p, /**< lexical environme
}
break;
}
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
case ECMA_LEXICAL_ENVIRONMENT_HOME_OBJECT_BOUND:
{
break;
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
default:
{
JERRY_ASSERT (ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND);
@@ -257,12 +257,12 @@ ecma_op_put_value_lex_env_base (ecma_object_t *lex_env_p, /**< lexical environme
ecma_value_t has_property = ecma_op_object_has_property (binding_obj_p, name_p);
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
#if ENABLED (JERRY_BUILTIN_PROXY)
if (ECMA_IS_VALUE_ERROR (has_property))
{
return has_property;
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
if (ecma_is_value_true (has_property))
{
@@ -35,7 +35,7 @@
* @{
*/
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
/**
* Implementation of 'CreateArrayFromList' specialized for iterators
@@ -602,7 +602,7 @@ ecma_op_iterator_do (ecma_iterator_command_type_t command, /**< command to be ex
return result;
} /* ecma_op_iterator_do */
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/**
* @}
@@ -18,7 +18,7 @@
#include "ecma-globals.h"
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
/** \addtogroup ecma ECMA
* @{
@@ -69,7 +69,7 @@ ecma_value_t
ecma_op_iterator_do (ecma_iterator_command_type_t command, ecma_value_t iterator,
ecma_value_t value, bool *done_p);
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/**
* @}
+2 -2
View File
@@ -21,7 +21,7 @@
#include "ecma-promise-object.h"
#include "jcontext.h"
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
#if ENABLED (JERRY_BUILTIN_PROMISE)
/**
* Mask for job queue type.
@@ -384,4 +384,4 @@ ecma_free_all_enqueued_jobs (void)
* @}
* @}
*/
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
#endif /* ENABLED (JERRY_BUILTIN_PROMISE) */
+2 -2
View File
@@ -16,7 +16,7 @@
#ifndef ECMA_JOB_QUEUE_H
#define ECMA_JOB_QUEUE_H
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
#if ENABLED (JERRY_BUILTIN_PROMISE)
/** \addtogroup ecma ECMA
* @{
@@ -54,5 +54,5 @@ ecma_value_t ecma_process_all_enqueued_jobs (void);
* @}
* @}
*/
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
#endif /* ENABLED (JERRY_BUILTIN_PROMISE) */
#endif /* !ECMA_JOB_QUEUE_H */
+13 -13
View File
@@ -45,9 +45,9 @@ ecma_init_global_environment (void)
glob_obj_p,
ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND);
ECMA_SET_NON_NULL_POINTER (JERRY_CONTEXT (ecma_global_env_cp), global_lex_env_p);
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
ECMA_SET_NON_NULL_POINTER (JERRY_CONTEXT (ecma_global_scope_cp), global_lex_env_p);
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
} /* ecma_init_global_environment */
/**
@@ -56,13 +56,13 @@ ecma_init_global_environment (void)
void
ecma_finalize_global_environment (void)
{
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
if (JERRY_CONTEXT (ecma_global_scope_cp) != JERRY_CONTEXT (ecma_global_env_cp))
{
ecma_deref_object (ECMA_GET_NON_NULL_POINTER (ecma_object_t, JERRY_CONTEXT (ecma_global_scope_cp)));
}
JERRY_CONTEXT (ecma_global_scope_cp) = JMEM_CP_NULL;
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
ecma_deref_object (ECMA_GET_NON_NULL_POINTER (ecma_object_t, JERRY_CONTEXT (ecma_global_env_cp)));
JERRY_CONTEXT (ecma_global_env_cp) = JMEM_CP_NULL;
} /* ecma_finalize_global_environment */
@@ -80,7 +80,7 @@ ecma_get_global_environment (void)
return ECMA_GET_NON_NULL_POINTER (ecma_object_t, JERRY_CONTEXT (ecma_global_env_cp));
} /* ecma_get_global_environment */
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
/**
* Create the global lexical block on top of the global environment.
*/
@@ -94,7 +94,7 @@ ecma_create_global_lexical_block (void)
ECMA_SET_NON_NULL_POINTER (JERRY_CONTEXT (ecma_global_scope_cp), global_scope_p);
}
} /* ecma_create_global_lexical_block */
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/**
* Get reference to Global lexical scope
@@ -105,12 +105,12 @@ ecma_create_global_lexical_block (void)
ecma_object_t *
ecma_get_global_scope (void)
{
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
JERRY_ASSERT (JERRY_CONTEXT (ecma_global_scope_cp) != JMEM_CP_NULL);
return ECMA_GET_NON_NULL_POINTER (ecma_object_t, JERRY_CONTEXT (ecma_global_scope_cp));
#else /* !ENABLED (JERRY_ES2015) */
#else /* !ENABLED (JERRY_ESNEXT) */
return ecma_get_global_environment ();
#endif /* !ENABLED (JERRY_ES2015) */
#endif /* !ENABLED (JERRY_ESNEXT) */
} /* ecma_get_global_scope */
/**
@@ -239,12 +239,12 @@ ecma_op_set_mutable_binding (ecma_object_t *lex_env_p, /**< lexical environment
{
ecma_named_data_property_assign_value (lex_env_p, ECMA_PROPERTY_VALUE_PTR (property_p), value);
}
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
else if (ecma_is_property_enumerable (*property_p))
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Constant bindings cannot be reassigned."));
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
else if (is_strict)
{
return ecma_raise_type_error (ECMA_ERR_MSG ("Binding cannot be set."));
@@ -433,7 +433,7 @@ ecma_op_create_immutable_binding (ecma_object_t *lex_env_p, /**< lexical environ
prop_value_p->value = ecma_copy_value_if_not_object (value);
} /* ecma_op_create_immutable_binding */
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
/**
* InitializeBinding operation.
*
@@ -569,7 +569,7 @@ ecma_op_this_binding_is_initialized (ecma_property_t *prop_p) /**< [[ThisBinding
return ECMA_PROPERTY_VALUE_PTR (prop_p)->value != ECMA_VALUE_UNINITIALIZED;
} /* ecma_op_this_binding_is_initialized */
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/**
* @}
+6 -6
View File
@@ -34,14 +34,14 @@ void ecma_init_global_environment (void);
void ecma_finalize_global_environment (void);
ecma_object_t *ecma_get_global_environment (void);
ecma_object_t *ecma_get_global_scope (void);
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
void ecma_create_global_lexical_block (void);
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
#if ENABLED (JERRY_ES2015_MODULE_SYSTEM)
#if ENABLED (JERRY_MODULE_SYSTEM)
void ecma_module_add_lex_env (ecma_object_t *lex_env_p);
void ecma_module_finalize_lex_envs (void);
#endif /* ENABLED (JERRY_ES2015_MODULE_SYSTEM) */
#endif /* ENABLED (JERRY_MODULE_SYSTEM) */
/**
* @}
@@ -66,7 +66,7 @@ ecma_value_t ecma_op_implicit_this_value (ecma_object_t *lex_env_p);
/* ECMA-262 v5, Table 18. Additional methods of Declarative Environment Records */
void ecma_op_create_immutable_binding (ecma_object_t *lex_env_p, ecma_string_t *name_p, ecma_value_t value);
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
void ecma_op_initialize_binding (ecma_object_t *lex_env_p, ecma_string_t *name_p, ecma_value_t value);
void
@@ -83,7 +83,7 @@ ecma_op_get_this_binding (ecma_object_t *lex_env_p);
void
ecma_op_bind_this_value (ecma_property_t *prop_p, ecma_value_t this_binding);
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/**
* @}
@@ -140,7 +140,7 @@ ecma_op_create_arguments_object (ecma_object_t *func_obj_p, /**< callee function
ecma_property_descriptor_t prop_desc = ecma_make_empty_property_descriptor ();
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
/* ECMAScript v6, 9.4.4.6.7, 9.4.4.7.22 */
ecma_string_t *symbol_p = ecma_op_get_global_symbol (LIT_GLOBAL_SYMBOL_ITERATOR);
@@ -154,7 +154,7 @@ ecma_op_create_arguments_object (ecma_object_t *func_obj_p, /**< callee function
JERRY_ASSERT (ecma_is_value_object (prop_value_p->value));
ecma_deref_object (ecma_get_object_from_value (prop_value_p->value));
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/* 13. */
if (!is_strict)
@@ -203,7 +203,7 @@ static const lit_magic_string_id_t to_primitive_non_string_hint_method_names[2]
LIT_MAGIC_STRING_TO_STRING_UL, /**< toString operation */
};
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
/**
* Hints for the ecma general object's toPrimitve operation
*/
@@ -213,7 +213,7 @@ static const lit_magic_string_id_t hints[3] =
LIT_MAGIC_STRING_NUMBER, /**< "number" hint */
LIT_MAGIC_STRING_STRING, /**< "string" hint */
};
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/**
* [[DefaultValue]] ecma general object's operation
@@ -232,7 +232,7 @@ ecma_op_general_object_default_value (ecma_object_t *obj_p, /**< the object */
JERRY_ASSERT (obj_p != NULL
&& !ecma_is_lexical_environment (obj_p));
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
ecma_value_t obj_value = ecma_make_object_value (obj_p);
ecma_value_t exotic_to_prim = ecma_op_get_method_by_symbol_id (obj_value,
@@ -272,7 +272,7 @@ ecma_op_general_object_default_value (ecma_object_t *obj_p, /**< the object */
{
hint = ECMA_PREFERRED_TYPE_NUMBER;
}
#else /* !ENABLED (JERRY_ES2015) */
#else /* !ENABLED (JERRY_ESNEXT) */
if (hint == ECMA_PREFERRED_TYPE_NO)
{
if (ecma_object_class_is (obj_p, LIT_MAGIC_STRING_DATE_UL))
@@ -284,7 +284,7 @@ ecma_op_general_object_default_value (ecma_object_t *obj_p, /**< the object */
hint = ECMA_PREFERRED_TYPE_NUMBER;
}
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
return ecma_op_general_object_ordinary_value (obj_p, hint);
} /* ecma_op_general_object_default_value */
@@ -363,12 +363,12 @@ ecma_op_general_object_define_own_property (ecma_object_t *object_p, /**< the ob
const ecma_property_descriptor_t *property_desc_p) /**< property
* descriptor */
{
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
#if ENABLED (JERRY_BUILTIN_PROXY)
if (ECMA_OBJECT_IS_PROXY (object_p))
{
return ecma_proxy_object_define_own_property (object_p, property_name_p, property_desc_p);
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
JERRY_ASSERT (object_p != NULL
&& !ecma_is_lexical_environment (object_p));
@@ -636,7 +636,7 @@ ecma_op_general_object_define_own_property (ecma_object_t *object_p, /**< the ob
#undef ECMA_PROPERTY_TYPE_GENERIC
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
/**
* The IsCompatiblePropertyDescriptor method for Proxy object internal methods
*
@@ -780,7 +780,7 @@ ecma_op_to_complete_property_descriptor (ecma_property_descriptor_t *desc_p) /**
desc_p->flags |= (ECMA_PROP_IS_GET_DEFINED | ECMA_PROP_IS_SET_DEFINED);
}
} /* ecma_op_to_complete_property_descriptor */
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/**
* @}
@@ -37,13 +37,13 @@ ecma_value_t ecma_op_general_object_ordinary_value (ecma_object_t *obj_p, ecma_p
ecma_value_t ecma_op_general_object_define_own_property (ecma_object_t *object_p, ecma_string_t *property_name_p,
const ecma_property_descriptor_t *property_desc_p);
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
void ecma_op_to_complete_property_descriptor (ecma_property_descriptor_t *desc_p);
bool ecma_op_is_compatible_property_descriptor (const ecma_property_descriptor_t *desc_p,
const ecma_property_descriptor_t *current_p,
bool is_extensible);
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/**
* @}
+131 -131
View File
@@ -29,11 +29,11 @@
#include "ecma-proxy-object.h"
#include "jcontext.h"
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
#include "ecma-typedarray-object.h"
#include "ecma-arraybuffer-object.h"
#include "ecma-try-catch-macro.h"
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
/** \addtogroup ecma ECMA
* @{
@@ -76,9 +76,9 @@ ecma_op_object_get_own_property (ecma_object_t *object_p, /**< the object */
{
JERRY_ASSERT (object_p != NULL
&& !ecma_is_lexical_environment (object_p));
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
#if ENABLED (JERRY_BUILTIN_PROXY)
JERRY_ASSERT (!ECMA_OBJECT_IS_PROXY (object_p));
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
JERRY_ASSERT (property_name_p != NULL);
JERRY_ASSERT (options == ECMA_PROPERTY_GET_NO_OPTIONS
|| options == ECMA_PROPERTY_GET_HAS_OWN_PROP
@@ -173,18 +173,18 @@ ecma_op_object_get_own_property (ecma_object_t *object_p, /**< the object */
break;
}
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
case ECMA_OBJECT_TYPE_PSEUDO_ARRAY:
{
/* ES2015 9.4.5.1 */
if (ecma_object_is_typedarray (object_p))
{
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
if (ecma_prop_name_is_symbol (property_name_p))
{
break;
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
uint32_t array_index = ecma_string_get_array_index (property_name_p);
@@ -232,7 +232,7 @@ ecma_op_object_get_own_property (ecma_object_t *object_p, /**< the object */
break;
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
default:
{
break;
@@ -256,7 +256,7 @@ ecma_op_object_get_own_property (ecma_object_t *object_p, /**< the object */
}
else if (type == ECMA_OBJECT_TYPE_FUNCTION)
{
#if !ENABLED (JERRY_ES2015)
#if !ENABLED (JERRY_ESNEXT)
if (ecma_string_is_length (property_name_p))
{
if (options & ECMA_PROPERTY_GET_VALUE)
@@ -282,7 +282,7 @@ ecma_op_object_get_own_property (ecma_object_t *object_p, /**< the object */
return ECMA_PROPERTY_TYPE_VIRTUAL;
}
#endif /* !ENABLED (JERRY_ES2015) */
#endif /* !ENABLED (JERRY_ESNEXT) */
/* Get prototype physical property. */
property_p = ecma_op_function_try_to_lazy_instantiate_property (object_p, property_name_p);
@@ -407,12 +407,12 @@ ecma_op_object_has_property (ecma_object_t *object_p, /**< the object */
{
while (true)
{
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
#if ENABLED (JERRY_BUILTIN_PROXY)
if (ECMA_OBJECT_IS_PROXY (object_p))
{
return ecma_proxy_object_has (object_p, property_name_p);
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
/* 2 - 3. */
if (ecma_op_ordinary_object_has_own_property (object_p, property_name_p))
@@ -544,16 +544,16 @@ ecma_op_object_find_own (ecma_value_t base_value, /**< base value */
}
}
}
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
/* ES2015 9.4.5.4 */
if (ecma_object_is_typedarray (object_p))
{
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
if (ecma_prop_name_is_symbol (property_name_p))
{
break;
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
uint32_t array_index = ecma_string_get_array_index (property_name_p);
@@ -583,7 +583,7 @@ ecma_op_object_find_own (ecma_value_t base_value, /**< base value */
ecma_deref_ecma_string (num_to_str);
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
break;
}
@@ -610,7 +610,7 @@ ecma_op_object_find_own (ecma_value_t base_value, /**< base value */
}
else if (type == ECMA_OBJECT_TYPE_FUNCTION)
{
#if !ENABLED (JERRY_ES2015)
#if !ENABLED (JERRY_ESNEXT)
if (ecma_string_is_length (property_name_p))
{
/* Get length virtual property. */
@@ -631,7 +631,7 @@ ecma_op_object_find_own (ecma_value_t base_value, /**< base value */
return ecma_make_uint32_value (len);
}
#endif /* !ENABLED (JERRY_ES2015) */
#endif /* !ENABLED (JERRY_ESNEXT) */
/* Get prototype physical property. */
property_p = ecma_op_function_try_to_lazy_instantiate_property (object_p, property_name_p);
@@ -734,12 +734,12 @@ ecma_op_object_find (ecma_object_t *object_p, /**< the object */
while (true)
{
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
#if ENABLED (JERRY_BUILTIN_PROXY)
if (ECMA_OBJECT_IS_PROXY (object_p))
{
return ecma_proxy_object_find (object_p, property_name_p);
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
ecma_value_t value = ecma_op_object_find_own (base_value, object_p, property_name_p);
@@ -834,12 +834,12 @@ ecma_op_object_get_with_receiver (ecma_object_t *object_p, /**< the object */
{
while (true)
{
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
#if ENABLED (JERRY_BUILTIN_PROXY)
if (ECMA_OBJECT_IS_PROXY (object_p))
{
return ecma_proxy_object_get (object_p, property_name_p, receiver);
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
ecma_value_t value = ecma_op_object_find_own (receiver, object_p, property_name_p);
@@ -931,7 +931,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 */
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
/**
* [[Get]] a well-known symbol by the given property id
*
@@ -1055,7 +1055,7 @@ ecma_op_get_method_by_magic_id (ecma_value_t value, /**< ecma value */
{
return ecma_op_get_method (value, ecma_get_magic_string (magic_id));
} /* ecma_op_get_method_by_magic_id */
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/**
* [[Put]] ecma general object's operation specialized for uint32_ property index
@@ -1138,7 +1138,7 @@ ecma_op_object_put (ecma_object_t *object_p, /**< the object */
is_throw);
} /* ecma_op_object_put */
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
/**
* [[Set]] ( P, V, Receiver) operation part for ordinary objects
*
@@ -1200,7 +1200,7 @@ ecma_op_object_put_apply_receiver (ecma_value_t receiver, /**< receiver */
return result;
}
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
#if ENABLED (JERRY_BUILTIN_PROXY)
if (ECMA_OBJECT_IS_PROXY (receiver_obj_p))
{
ecma_property_descriptor_t desc;
@@ -1208,7 +1208,7 @@ ecma_op_object_put_apply_receiver (ecma_value_t receiver, /**< receiver */
desc.value = value;
return ecma_proxy_object_define_own_property (receiver_obj_p, property_name_p, &desc);
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
if (JERRY_UNLIKELY (ecma_op_object_is_fast_array (receiver_obj_p)))
{
@@ -1226,7 +1226,7 @@ ecma_op_object_put_apply_receiver (ecma_value_t receiver, /**< receiver */
return ECMA_VALUE_TRUE;
} /* ecma_op_object_put_apply_receiver */
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/**
* [[Put]] ecma general object's operation with given receiver
@@ -1258,12 +1258,12 @@ ecma_op_object_put_with_receiver (ecma_object_t *object_p, /**< the object */
&& !ecma_is_lexical_environment (object_p));
JERRY_ASSERT (property_name_p != NULL);
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
#if ENABLED (JERRY_BUILTIN_PROXY)
if (ECMA_OBJECT_IS_PROXY (object_p))
{
return ecma_proxy_object_set (object_p, property_name_p, value, receiver);
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
ecma_object_type_t type = ecma_get_object_type (object_p);
@@ -1334,16 +1334,16 @@ ecma_op_object_put_with_receiver (ecma_object_t *object_p, /**< the object */
}
}
}
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
/* ES2015 9.4.5.5 */
if (ecma_object_is_typedarray (object_p))
{
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
if (ecma_prop_name_is_symbol (property_name_p))
{
break;
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
uint32_t array_index = ecma_string_get_array_index (property_name_p);
@@ -1383,7 +1383,7 @@ ecma_op_object_put_with_receiver (ecma_object_t *object_p, /**< the object */
ecma_deref_ecma_string (num_to_str);
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
break;
}
default:
@@ -1430,19 +1430,19 @@ ecma_op_object_put_with_receiver (ecma_object_t *object_p, /**< the object */
}
else if (type == ECMA_OBJECT_TYPE_FUNCTION)
{
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
/* Uninitialized 'length' property is non-writable (ECMA-262 v6, 19.2.4.1) */
if ((ecma_string_is_length (property_name_p))
&& (!ECMA_GET_FIRST_BIT_FROM_POINTER_TAG (((ecma_extended_object_t *) object_p)->u.function.scope_cp)))
{
return ecma_reject (is_throw);
}
#else /* !ENABLED (JERRY_ES2015) */
#else /* !ENABLED (JERRY_ESNEXT) */
if (ecma_string_is_length (property_name_p))
{
return ecma_reject (is_throw);
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/* Get prototype physical property. */
property_p = ecma_op_function_try_to_lazy_instantiate_property (object_p, property_name_p);
@@ -1465,12 +1465,12 @@ ecma_op_object_put_with_receiver (ecma_object_t *object_p, /**< the object */
{
if (ecma_is_property_writable (*property_p))
{
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
if (ecma_make_object_value (object_p) != receiver)
{
return ecma_op_object_put_apply_receiver (receiver, property_name_p, value, is_throw);
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/* There is no need for special casing arrays here because changing the
* value of an existing property never changes the length of an array. */
@@ -1500,7 +1500,7 @@ ecma_op_object_put_with_receiver (ecma_object_t *object_p, /**< the object */
ecma_property_ref_t property_ref = { NULL };
ecma_object_t *proto_p = ECMA_GET_NON_NULL_POINTER (ecma_object_t, proto_cp);
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
#if ENABLED (JERRY_BUILTIN_PROXY)
if (ECMA_OBJECT_IS_PROXY (proto_p))
{
return ecma_op_object_put_with_receiver (proto_p,
@@ -1509,7 +1509,7 @@ ecma_op_object_put_with_receiver (ecma_object_t *object_p, /**< the object */
receiver,
is_throw);
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
ecma_property_t inherited_property = ecma_op_object_get_property (proto_p,
property_name_p,
@@ -1567,9 +1567,9 @@ ecma_op_object_put_with_receiver (ecma_object_t *object_p, /**< the object */
}
}
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
return ecma_op_object_put_apply_receiver (receiver, property_name_p, value, is_throw);
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
ecma_property_value_t *new_prop_value_p;
new_prop_value_p = ecma_create_named_data_property (object_p,
@@ -1682,12 +1682,12 @@ ecma_op_object_delete (ecma_object_t *obj_p, /**< the object */
}
}
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
#if ENABLED (JERRY_BUILTIN_PROXY)
if (ECMA_OBJECT_IS_PROXY (obj_p))
{
return ecma_proxy_object_delete_property (obj_p, property_name_p);
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
JERRY_ASSERT_OBJECT_TYPE_IS_VALID (ecma_get_object_type (obj_p));
@@ -1754,12 +1754,12 @@ ecma_op_object_define_own_property (ecma_object_t *obj_p, /**< the object */
const ecma_object_type_t type = ecma_get_object_type (obj_p);
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
#if ENABLED (JERRY_BUILTIN_PROXY)
if (ECMA_OBJECT_IS_PROXY (obj_p))
{
return ecma_proxy_object_define_own_property (obj_p, property_name_p, property_desc_p);
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
switch (type)
{
@@ -1787,28 +1787,28 @@ 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;
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
if (ext_object_p->u.pseudo_array.type == ECMA_PSEUDO_ARRAY_ARGUMENTS)
{
#else /* !ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
#else /* !ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
JERRY_ASSERT (ext_object_p->u.pseudo_array.type == ECMA_PSEUDO_ARRAY_ARGUMENTS);
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
return ecma_op_arguments_object_define_own_property (obj_p,
property_name_p,
property_desc_p);
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
}
/* ES2015 9.4.5.3 */
if (ecma_object_is_typedarray (obj_p))
{
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
if (ecma_prop_name_is_symbol (property_name_p))
{
return ecma_op_general_object_define_own_property (obj_p,
property_name_p,
property_desc_p);
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
uint32_t array_index = ecma_string_get_array_index (property_name_p);
if (array_index != ECMA_STRING_NOT_ARRAY_INDEX)
@@ -1841,9 +1841,9 @@ ecma_op_object_define_own_property (ecma_object_t *obj_p, /**< the object */
return ecma_op_general_object_define_own_property (obj_p,
property_name_p,
property_desc_p);
#else /* !ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
#else /* !ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
break;
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
}
}
} /* ecma_op_object_define_own_property */
@@ -1870,12 +1870,12 @@ ecma_op_object_get_own_property_descriptor (ecma_object_t *object_p, /**< the ob
{
*prop_desc_p = ecma_make_empty_property_descriptor ();
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
#if ENABLED (JERRY_BUILTIN_PROXY)
if (ECMA_OBJECT_IS_PROXY (object_p))
{
return ecma_proxy_object_get_own_property_descriptor (object_p, property_name_p, prop_desc_p);
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
ecma_property_ref_t property_ref;
@@ -1985,7 +1985,7 @@ ecma_op_object_is_prototype_of (ecma_object_t *base_p, /**< base object */
do
{
jmem_cpointer_t target_cp;
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
#if ENABLED (JERRY_BUILTIN_PROXY)
if (ECMA_OBJECT_IS_PROXY (target_p))
{
ecma_value_t target_proto = ecma_proxy_object_get_prototype_of (target_p);
@@ -1998,11 +1998,11 @@ ecma_op_object_is_prototype_of (ecma_object_t *base_p, /**< base object */
}
else
{
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
target_cp = ecma_op_ordinary_object_get_prototype_of (target_p);
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
#if ENABLED (JERRY_BUILTIN_PROXY)
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
if (target_cp == JMEM_CP_NULL)
{
@@ -2040,7 +2040,7 @@ ecma_op_object_get_property_names (ecma_object_t *obj_p, /**< object */
JERRY_ASSERT (obj_p != NULL
&& !ecma_is_lexical_environment (obj_p));
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
#if ENABLED (JERRY_BUILTIN_PROXY)
if (ECMA_OBJECT_IS_PROXY (obj_p))
{
/* Integrated a part of ECMA 262 v6 7.3.21 EnumerableOwnNames operation. */
@@ -2075,7 +2075,7 @@ ecma_op_object_get_property_names (ecma_object_t *obj_p, /**< object */
ecma_collection_destroy (proxy_keys);
return return_keys;
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
if (ecma_op_object_is_fast_array (obj_p))
{
@@ -2088,10 +2088,10 @@ 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;
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
const bool is_symbols = (opts & ECMA_LIST_SYMBOLS) != 0;
const bool is_symbols_only = (opts & ECMA_LIST_SYMBOLS_ONLY) != 0;
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
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;
@@ -2105,15 +2105,15 @@ ecma_op_object_get_property_names (ecma_object_t *obj_p, /**< object */
const bool obj_is_builtin = ecma_get_object_is_builtin (obj_p);
ecma_length_t string_named_properties_count = 0;
ecma_length_t array_index_named_properties_count = 0;
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
ecma_length_t symbol_named_properties_count = 0;
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
ecma_collection_t *prop_names_p = ecma_new_collection ();
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
if (JERRY_LIKELY (!is_symbols_only))
{
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
if (obj_is_builtin)
{
@@ -2138,12 +2138,12 @@ ecma_op_object_get_property_names (ecma_object_t *obj_p, /**< object */
{
case ECMA_OBJECT_TYPE_PSEUDO_ARRAY:
{
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
if (ecma_object_is_typedarray (obj_p))
{
ecma_op_typedarray_list_lazy_property_names (obj_p, prop_names_p);
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
break;
}
case ECMA_OBJECT_TYPE_FUNCTION:
@@ -2209,9 +2209,9 @@ ecma_op_object_get_property_names (ecma_object_t *obj_p, /**< object */
}
}
}
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
ecma_value_t *buffer_p = prop_names_p->buffer_p;
uint32_t lazy_prop_name_count = prop_names_p->item_count;
@@ -2228,21 +2228,21 @@ ecma_op_object_get_property_names (ecma_object_t *obj_p, /**< object */
{
array_index_named_properties_count++;
}
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
else if (ecma_prop_name_is_symbol (name_p))
{
symbol_named_properties_count++;
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
else
{
string_named_properties_count++;
}
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
/* Symbols are never lazy listed */
JERRY_ASSERT (!ecma_prop_name_is_symbol (name_p));
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
uint8_t hash = (uint8_t) ecma_string_hash (name_p);
uint32_t bitmap_row = (uint32_t) (hash / bitmap_row_size);
@@ -2345,7 +2345,7 @@ ecma_op_object_get_property_names (ecma_object_t *obj_p, /**< object */
if (!(is_enumerable_only && !ecma_is_property_enumerable (*property_p)))
{
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
/* We skip the current property in the following cases:
1. We don't want to list symbols (is_symbols and is_symbols_only are false)
and the current property is a symbol.
@@ -2357,7 +2357,7 @@ ecma_op_object_get_property_names (ecma_object_t *obj_p, /**< object */
ecma_deref_ecma_string (name_p);
continue;
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
uint8_t hash = (uint8_t) ecma_string_hash (name_p);
uint32_t bitmap_row = (uint32_t) (hash / bitmap_row_size);
@@ -2390,18 +2390,18 @@ ecma_op_object_get_property_names (ecma_object_t *obj_p, /**< object */
}
else if (!is_array_indices_only)
{
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
if (ecma_prop_name_is_symbol (name_p))
{
symbol_named_properties_count++;
}
else
{
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
string_named_properties_count++;
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
}
else
{
@@ -2433,24 +2433,24 @@ ecma_op_object_get_property_names (ecma_object_t *obj_p, /**< object */
ecma_length_t all_properties_count = array_index_named_properties_count + string_named_properties_count;
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
all_properties_count += symbol_named_properties_count;
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/* Second pass: collecting property names into an array. */
JMEM_DEFINE_LOCAL_ARRAY (names_p, all_properties_count, ecma_string_t *);
ecma_string_t **string_names_p = names_p + array_index_named_properties_count;
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
ecma_string_t **symbol_names_p = string_names_p + string_named_properties_count;
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
uint32_t array_index_name_pos = 0;
uint32_t string_name_pos = string_named_properties_count;
uint32_t lazy_string_name_pos = 0;
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
uint32_t symbol_name_pos = symbol_named_properties_count;
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
buffer_p = prop_names_p->buffer_p;
@@ -2493,7 +2493,7 @@ ecma_op_object_get_property_names (ecma_object_t *obj_p, /**< object */
names_p[insertion_pos] = name_p;
}
}
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
else if (ecma_prop_name_is_symbol (name_p))
{
// Put in the symbols in reverse order.
@@ -2502,7 +2502,7 @@ ecma_op_object_get_property_names (ecma_object_t *obj_p, /**< object */
symbol_names_p[--symbol_name_pos] = name_p;
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
else
{
// Put in the strings in reverse order.
@@ -2522,9 +2522,9 @@ ecma_op_object_get_property_names (ecma_object_t *obj_p, /**< object */
JERRY_ASSERT (array_index_name_pos == array_index_named_properties_count);
JERRY_ASSERT (string_name_pos - lazy_string_name_pos == 0);
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
JERRY_ASSERT (symbol_name_pos == 0);
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
ecma_collection_free (prop_names_p);
@@ -2617,10 +2617,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)
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
#if ENABLED (JERRY_BUILTIN_PROMISE)
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_PROMISE_PROTOTYPE)
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
#endif /* ENABLED (JERRY_BUILTIN_PROMISE) */
#if ENABLED (JERRY_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)
@@ -2634,8 +2634,8 @@ ecma_object_check_class_name_is_object (ecma_object_t *obj_p) /**< object */
#if ENABLED (JERRY_NUMBER_TYPE_FLOAT64)
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_FLOAT64ARRAY_PROTOTYPE)
#endif /* ENABLED (JERRY_NUMBER_TYPE_FLOAT64) */
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
#if ENABLED (JERRY_ES2015)
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
#if ENABLED (JERRY_ESNEXT)
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_ARRAY_PROTOTYPE_UNSCOPABLES)
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_ARRAY_ITERATOR_PROTOTYPE)
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_ITERATOR_PROTOTYPE)
@@ -2654,28 +2654,28 @@ ecma_object_check_class_name_is_object (ecma_object_t *obj_p) /**< object */
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_DATE_PROTOTYPE)
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_REGEXP_PROTOTYPE)
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_SYMBOL_PROTOTYPE)
#endif /* ENABLED (JERRY_ES2015) */
#if ENABLED (JERRY_ES2015_BUILTIN_MAP)
#endif /* ENABLED (JERRY_ESNEXT) */
#if ENABLED (JERRY_BUILTIN_MAP)
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_MAP_PROTOTYPE)
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_MAP_ITERATOR_PROTOTYPE)
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ES2015_BUILTIN_MAP) */
#if ENABLED (JERRY_ES2015_BUILTIN_SET)
#endif /* ENABLED (JERRY_ESNEXT) */
#endif /* ENABLED (JERRY_BUILTIN_MAP) */
#if ENABLED (JERRY_BUILTIN_SET)
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_SET_PROTOTYPE)
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_SET_ITERATOR_PROTOTYPE)
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ES2015_BUILTIN_SET) */
#if ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP)
#endif /* ENABLED (JERRY_ESNEXT) */
#endif /* ENABLED (JERRY_BUILTIN_SET) */
#if ENABLED (JERRY_BUILTIN_WEAKMAP)
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_WEAKMAP_PROTOTYPE)
#endif /* ENABLED (JERRY_ES2015_BUILTIN_WEAKMAP) */
#if ENABLED (JERRY_ES2015_BUILTIN_WEAKSET)
#endif /* ENABLED (JERRY_BUILTIN_WEAKMAP) */
#if ENABLED (JERRY_BUILTIN_WEAKSET)
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_WEAKSET_PROTOTYPE)
#endif /* ENABLED (JERRY_ES2015_BUILTIN_WEAKSET) */
#if ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW)
#endif /* ENABLED (JERRY_BUILTIN_WEAKSET) */
#if ENABLED (JERRY_BUILTIN_DATAVIEW)
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_DATAVIEW_PROTOTYPE)
#endif /* ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW) */
#endif /* ENABLED (JERRY_BUILTIN_DATAVIEW) */
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_OBJECT_PROTOTYPE));
#else /* JERRY_NDEBUG */
JERRY_UNUSED (obj_p);
@@ -2711,14 +2711,14 @@ ecma_object_get_class_name (ecma_object_t *obj_p) /**< object */
switch (ext_obj_p->u.pseudo_array.type)
{
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
#if ENABLED (JERRY_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 /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
#if ENABLED (JERRY_ES2015)
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
#if ENABLED (JERRY_ESNEXT)
case ECMA_PSEUDO_ARRAY_ITERATOR:
{
return LIT_MAGIC_STRING_ARRAY_ITERATOR_UL;
@@ -2731,13 +2731,13 @@ ecma_object_get_class_name (ecma_object_t *obj_p) /**< object */
{
return LIT_MAGIC_STRING_MAP_ITERATOR_UL;
}
#endif /* ENABLED (JERRY_ES2015) */
#if ENABLED (JERRY_ES2015)
#endif /* ENABLED (JERRY_ESNEXT) */
#if ENABLED (JERRY_ESNEXT)
case ECMA_PSEUDO_STRING_ITERATOR:
{
return LIT_MAGIC_STRING_STRING_ITERATOR_UL;
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
default:
{
JERRY_ASSERT (ext_obj_p->u.pseudo_array.type == ECMA_PSEUDO_ARRAY_ARGUMENTS);
@@ -2770,25 +2770,25 @@ ecma_object_get_class_name (ecma_object_t *obj_p) /**< object */
return LIT_MAGIC_STRING_MATH_UL;
}
#endif /* ENABLED (JERRY_BUILTIN_MATH) */
#if ENABLED (JERRY_ES2015_BUILTIN_REFLECT)
#if ENABLED (JERRY_BUILTIN_REFLECT)
case ECMA_BUILTIN_ID_REFLECT:
{
return LIT_MAGIC_STRING_REFLECT_UL;
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_REFLECT) */
#if ENABLED (JERRY_ES2015)
#endif /* ENABLED (JERRY_BUILTIN_REFLECT) */
#if ENABLED (JERRY_ESNEXT)
case ECMA_BUILTIN_ID_GENERATOR:
{
return LIT_MAGIC_STRING_GENERATOR_UL;
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
#if ENABLED (JERRY_BUILTIN_JSON)
case ECMA_BUILTIN_ID_JSON:
{
return LIT_MAGIC_STRING_JSON_U;
}
#endif /* ENABLED (JERRY_BUILTIN_JSON) */
#if !ENABLED (JERRY_ES2015)
#if !ENABLED (JERRY_ESNEXT)
#if ENABLED (JERRY_BUILTIN_ERRORS)
case ECMA_BUILTIN_ID_EVAL_ERROR_PROTOTYPE:
case ECMA_BUILTIN_ID_RANGE_ERROR_PROTOTYPE:
@@ -2801,13 +2801,13 @@ ecma_object_get_class_name (ecma_object_t *obj_p) /**< object */
{
return LIT_MAGIC_STRING_ERROR_UL;
}
#endif /* !ENABLED (JERRY_ES2015) */
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
#endif /* !ENABLED (JERRY_ESNEXT) */
#if ENABLED (JERRY_BUILTIN_PROXY)
case ECMA_BUILTIN_ID_PROXY:
{
return LIT_MAGIC_STRING_FUNCTION_UL;
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
default:
{
JERRY_ASSERT (ecma_object_check_class_name_is_object (obj_p));
@@ -2860,7 +2860,7 @@ ecma_object_is_regexp_object (ecma_value_t arg) /**< argument */
&& ecma_object_class_is (ecma_get_object_from_value (arg), LIT_MAGIC_STRING_REGEXP_UL));
} /* ecma_object_is_regexp_object */
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
/**
* Object's IsConcatSpreadable operation, used for Array.prototype.concat
* It checks the argument's [Symbol.isConcatSpreadable] property value
@@ -3007,7 +3007,7 @@ ecma_op_invoke_by_symbol_id (ecma_value_t object, /**< Object value */
return ret_value;
} /* ecma_op_invoke_by_symbol_id */
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/**
* 7.3.18 Abstract operation Invoke when property name is a magic string
@@ -3139,12 +3139,12 @@ ecma_op_ordinary_object_set_prototype_of (ecma_object_t *obj_p, /**< base object
}
/* 8.c.i */
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
#if ENABLED (JERRY_BUILTIN_PROXY)
if (ECMA_OBJECT_IS_PROXY (iter_p))
{
break;
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
/* 8.c.ii */
iter_p = ECMA_GET_POINTER (ecma_object_t, ecma_op_ordinary_object_get_prototype_of (iter_p));
+4 -4
View File
@@ -42,12 +42,12 @@ ecma_value_t ecma_op_object_get_with_receiver (ecma_object_t *object_p, ecma_str
ecma_value_t ecma_op_object_get_length (ecma_object_t *object_p, uint32_t *length_p);
ecma_value_t ecma_op_object_get_by_uint32_index (ecma_object_t *object_p, uint32_t index);
ecma_value_t ecma_op_object_get_by_magic_id (ecma_object_t *object_p, lit_magic_string_id_t property_id);
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
ecma_string_t *ecma_op_get_global_symbol (lit_magic_string_id_t property_id);
ecma_value_t ecma_op_object_get_by_symbol_id (ecma_object_t *object_p, lit_magic_string_id_t property_id);
ecma_value_t ecma_op_get_method_by_symbol_id (ecma_value_t value, lit_magic_string_id_t symbol_id);
ecma_value_t ecma_op_get_method_by_magic_id (ecma_value_t value, lit_magic_string_id_t magic_id);
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
ecma_value_t ecma_op_object_put_with_receiver (ecma_object_t *object_p, ecma_string_t *property_name_p,
ecma_value_t value, ecma_value_t receiver, bool is_throw);
ecma_value_t ecma_op_object_put (ecma_object_t *object_p, ecma_string_t *property_name_p, ecma_value_t value,
@@ -73,13 +73,13 @@ ecma_collection_t * ecma_op_object_get_property_names (ecma_object_t *obj_p, uin
lit_magic_string_id_t ecma_object_get_class_name (ecma_object_t *obj_p);
bool ecma_object_class_is (ecma_object_t *object_p, uint32_t class_id);
bool ecma_object_is_regexp_object (ecma_value_t arg);
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
ecma_value_t ecma_op_is_concat_spreadable (ecma_value_t arg);
ecma_value_t ecma_op_is_regexp (ecma_value_t arg);
ecma_value_t ecma_op_species_constructor (ecma_object_t *this_value, ecma_builtin_id_t default_constructor_id);
ecma_value_t ecma_op_invoke_by_symbol_id (ecma_value_t object, lit_magic_string_id_t magic_string_id,
ecma_value_t *args_p, ecma_length_t args_len);
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
ecma_value_t ecma_op_invoke (ecma_value_t object, ecma_string_t *property_name_p, ecma_value_t *args_p,
ecma_length_t args_len);
ecma_value_t ecma_op_invoke_by_magic_id (ecma_value_t object, lit_magic_string_id_t magic_string_id,
@@ -26,7 +26,7 @@
#include "ecma-promise-object.h"
#include "jcontext.h"
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
#if ENABLED (JERRY_BUILTIN_PROMISE)
/** \addtogroup ecma ECMA
* @{
@@ -967,4 +967,4 @@ ecma_promise_then (ecma_value_t promise, /**< the promise which call 'then' */
* @}
* @}
*/
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
#endif /* ENABLED (JERRY_BUILTIN_PROMISE) */
@@ -16,7 +16,7 @@
#ifndef ECMA_PROMISE_OBJECT_H
#define ECMA_PROMISE_OBJECT_H
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
#if ENABLED (JERRY_BUILTIN_PROMISE)
#include "ecma-globals.h"
/** \addtogroup ecma ECMA
@@ -98,5 +98,5 @@ void ecma_promise_free_resolving_functions (ecma_promise_resolving_functions_t *
* @}
*/
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROMISE) */
#endif /* ENABLED (JERRY_BUILTIN_PROMISE) */
#endif /* !ECMA_PROMISE_OBJECT_H */
@@ -34,7 +34,7 @@
* @{
*/
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
#if ENABLED (JERRY_BUILTIN_PROXY)
/**
* Check whether the argument satifies the requrements of [[ProxyTarget]] or [[ProxyHandler]]
*
@@ -1810,7 +1810,7 @@ ecma_proxy_object_construct (ecma_object_t *obj_p, /**< proxy object */
return new_obj;
} /* ecma_proxy_object_construct */
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
/**
* @}
@@ -25,7 +25,7 @@
* @{
*/
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
#if ENABLED (JERRY_BUILTIN_PROXY)
ecma_object_t *
ecma_proxy_create (ecma_value_t target,
@@ -110,7 +110,7 @@ ecma_proxy_object_construct (ecma_object_t *obj_p,
const ecma_value_t *args_p,
ecma_length_t argc);
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
/**
* @}
+28 -28
View File
@@ -47,22 +47,22 @@ ecma_op_resolve_reference_base (ecma_object_t *lex_env_p, /**< starting lexical
while (true)
{
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
if (ecma_get_lex_env_type (lex_env_p) == ECMA_LEXICAL_ENVIRONMENT_HOME_OBJECT_BOUND)
{
JERRY_ASSERT (lex_env_p->u2.outer_reference_cp != JMEM_CP_NULL);
lex_env_p = ECMA_GET_NON_NULL_POINTER (ecma_object_t, lex_env_p->u2.outer_reference_cp);
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
ecma_value_t has_binding = ecma_op_has_binding (lex_env_p, name_p);
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
#if ENABLED (JERRY_BUILTIN_PROXY)
if (ECMA_IS_VALUE_ERROR (has_binding))
{
return ECMA_OBJECT_POINTER_ERROR;
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
if (ecma_is_value_true (has_binding))
{
@@ -78,7 +78,7 @@ ecma_op_resolve_reference_base (ecma_object_t *lex_env_p, /**< starting lexical
}
} /* ecma_op_resolve_reference_base */
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
/**
* Perform GetThisEnvironment and GetSuperBase operations
*
@@ -99,12 +99,12 @@ ecma_op_resolve_super_base (ecma_object_t *lex_env_p) /**< starting lexical envi
{
ecma_object_t *home_p = ECMA_GET_NON_NULL_POINTER (ecma_object_t, lex_env_p->u1.home_object_cp);
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
#if ENABLED (JERRY_BUILTIN_PROXY)
if (ECMA_OBJECT_IS_PROXY (home_p))
{
return ecma_proxy_object_get_prototype_of (home_p);
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
jmem_cpointer_t proto_cp = ecma_op_ordinary_object_get_prototype_of (home_p);
@@ -173,7 +173,7 @@ ecma_op_is_prop_unscopable (ecma_object_t *binding_obj_p, /**< binding object */
return ECMA_VALUE_FALSE;
} /* ecma_op_is_prop_unscopable */
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/**
* Helper method for HasBindig operation
@@ -205,7 +205,7 @@ ecma_op_object_bound_environment_resolve_reference_value (ecma_object_t *lex_env
ecma_object_t *binding_obj_p = ecma_get_lex_env_binding_object (lex_env_p);
ecma_value_t found_binding;
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
#if ENABLED (JERRY_BUILTIN_PROXY)
if (ECMA_OBJECT_IS_PROXY (binding_obj_p))
{
found_binding = ecma_proxy_object_has (binding_obj_p, name_p);
@@ -217,7 +217,7 @@ ecma_op_object_bound_environment_resolve_reference_value (ecma_object_t *lex_env
}
else
{
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
found_binding = ecma_op_object_find (binding_obj_p, name_p);
if (ECMA_IS_VALUE_ERROR (found_binding) || !ecma_is_value_found (found_binding))
@@ -225,39 +225,39 @@ ecma_op_object_bound_environment_resolve_reference_value (ecma_object_t *lex_env
return found_binding;
}
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
if (JERRY_LIKELY (lex_env_p == ecma_get_global_scope ()))
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
{
return found_binding;
}
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
#if ENABLED (JERRY_BUILTIN_PROXY)
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
ecma_value_t blocked = ecma_op_is_prop_unscopable (binding_obj_p, name_p);
if (ecma_is_value_false (blocked))
{
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
#if ENABLED (JERRY_BUILTIN_PROXY)
if (ECMA_OBJECT_IS_PROXY (binding_obj_p))
{
return ecma_proxy_object_get (binding_obj_p, name_p, ecma_make_object_value (binding_obj_p));
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
return found_binding;
}
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
#if ENABLED (JERRY_BUILTIN_PROXY)
if (!ECMA_OBJECT_IS_PROXY (binding_obj_p))
{
ecma_free_value (found_binding);
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
return ECMA_IS_VALUE_ERROR (blocked) ? blocked : ECMA_VALUE_NOT_FOUND;
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
} /* ecma_op_object_bound_environment_resolve_reference_value */
/**
@@ -283,24 +283,24 @@ ecma_op_resolve_reference_value (ecma_object_t *lex_env_p, /**< starting lexical
{
ecma_property_value_t *property_value_p = ECMA_PROPERTY_VALUE_PTR (property_p);
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
if (JERRY_UNLIKELY (property_value_p->value == ECMA_VALUE_UNINITIALIZED))
{
return ecma_raise_reference_error (ECMA_ERR_MSG ("Variables declared by let/const must be"
" initialized before reading their value."));
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
return ecma_fast_copy_value (property_value_p->value);
}
}
else if (lex_env_type == ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND)
{
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
bool lcache_lookup_allowed = (lex_env_p == ecma_get_global_environment ());
#else /* !ENABLED (JERRY_ES2015)*/
#else /* !ENABLED (JERRY_ESNEXT)*/
bool lcache_lookup_allowed = true;
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
if (lcache_lookup_allowed)
{
@@ -344,11 +344,11 @@ ecma_op_resolve_reference_value (ecma_object_t *lex_env_p, /**< starting lexical
}
else
{
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
JERRY_ASSERT (lex_env_type == ECMA_LEXICAL_ENVIRONMENT_HOME_OBJECT_BOUND);
#else /* !ENABLED (JERRY_ES2015) */
#else /* !ENABLED (JERRY_ESNEXT) */
JERRY_UNREACHABLE ();
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
}
if (lex_env_p->u2.outer_reference_cp == JMEM_CP_NULL)
+2 -2
View File
@@ -29,9 +29,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);
ecma_value_t ecma_op_object_bound_environment_resolve_reference_value (ecma_object_t *lex_env_p, ecma_string_t *name_p);
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
ecma_value_t ecma_op_resolve_super_base (ecma_object_t *lex_env_p);
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/**
* @}
+50 -50
View File
@@ -120,7 +120,7 @@ ecma_regexp_parse_flags (ecma_string_t *flags_str_p, /**< Input string with flag
return ret_value;
} /* ecma_regexp_parse_flags */
#if !ENABLED (JERRY_ES2015)
#if !ENABLED (JERRY_ESNEXT)
/*
* Create the properties of a RegExp instance.
*/
@@ -193,7 +193,7 @@ ecma_regexp_update_props (ecma_object_t *re_object_p, /**< RegExp object */
prop_value_p = ECMA_PROPERTY_VALUE_PTR (prop_p);
prop_value_p->value = ecma_make_boolean_value (flags & RE_FLAG_MULTILINE);
} /* ecma_regexp_update_props */
#endif /* !ENABLED (JERRY_ES2015) */
#endif /* !ENABLED (JERRY_ESNEXT) */
/**
* RegExpAlloc method
@@ -209,7 +209,7 @@ ecma_regexp_update_props (ecma_object_t *re_object_p, /**< RegExp object */
ecma_object_t *
ecma_op_regexp_alloc (ecma_object_t *ctr_obj_p) /**< constructor object pointer */
{
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
if (ctr_obj_p == NULL)
{
ctr_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_REGEXP);
@@ -223,18 +223,18 @@ ecma_op_regexp_alloc (ecma_object_t *ctr_obj_p) /**< constructor object pointer
return proto_obj_p;
}
#else /* !ENABLED (JERRY_ES2015) */
#else /* !ENABLED (JERRY_ESNEXT) */
JERRY_UNUSED (ctr_obj_p);
ecma_object_t *proto_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_REGEXP_PROTOTYPE);
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
ecma_object_t *new_object_p = ecma_create_object (proto_obj_p,
sizeof (ecma_extended_object_t),
ECMA_OBJECT_TYPE_CLASS);
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
ecma_deref_object (proto_obj_p);
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
ecma_extended_object_t *regexp_obj_p = (ecma_extended_object_t *) new_object_p;
@@ -262,7 +262,7 @@ ecma_op_regexp_initialize (ecma_object_t *regexp_obj_p, /**< RegExp object */
{
ecma_extended_object_t *ext_obj_p = (ecma_extended_object_t *) regexp_obj_p;
#if !ENABLED (JERRY_ES2015)
#if !ENABLED (JERRY_ESNEXT)
if (ext_obj_p->u.class_prop.class_id == LIT_MAGIC_STRING_UNDEFINED)
{
/* This instance has not been initialized before. */
@@ -272,12 +272,12 @@ ecma_op_regexp_initialize (ecma_object_t *regexp_obj_p, /**< RegExp object */
{
ecma_regexp_update_props (regexp_obj_p, pattern_str_p, flags);
}
#endif /* !ENABLED (JERRY_ES2015) */
#endif /* !ENABLED (JERRY_ESNEXT) */
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
JERRY_UNUSED (pattern_str_p);
JERRY_UNUSED (flags);
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
ext_obj_p->u.class_prop.class_id = LIT_MAGIC_STRING_REGEXP_UL;
ECMA_SET_INTERNAL_VALUE_POINTER (ext_obj_p->u.class_prop.u.value, bc_p);
@@ -413,13 +413,13 @@ ecma_regexp_canonicalize_char (lit_code_point_t ch, /**< character */
return ch;
}
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
/* TODO: Implement case folding for code points in the upper planes. */
if (JERRY_UNLIKELY (ch > LIT_UTF16_CODE_UNIT_MAX))
{
return ch;
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
ecma_char_t u[LIT_MAXIMUM_OTHER_CASE_LENGTH];
const ecma_length_t size = lit_char_to_upper_case ((ecma_char_t) ch, u, LIT_MAXIMUM_OTHER_CASE_LENGTH);
@@ -514,7 +514,7 @@ ecma_regexp_advance (ecma_regexp_ctx_t *re_ctx_p, /**< regexp context */
JERRY_ASSERT (str_p != NULL);
lit_code_point_t cp = lit_cesu8_read_next (str_p);
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
if (JERRY_UNLIKELY (re_ctx_p->flags & RE_FLAG_UNICODE)
&& lit_is_code_point_utf16_high_surrogate ((ecma_char_t) cp)
&& *str_p < re_ctx_p->input_end_p)
@@ -526,12 +526,12 @@ ecma_regexp_advance (ecma_regexp_ctx_t *re_ctx_p, /**< regexp context */
*str_p += LIT_UTF8_MAX_BYTES_IN_CODE_UNIT;
}
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
return ecma_regexp_canonicalize (cp, re_ctx_p->flags);
} /* ecma_regexp_advance */
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
/**
* Helper function to get current full unicode code point and advance the string pointer.
*
@@ -559,7 +559,7 @@ ecma_regexp_unicode_advance (const lit_utf8_byte_t **str_p, /**< reference to st
*str_p = current_p;
return ch;
} /* ecma_regexp_unicode_advance */
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/**
* Helper function to revert the string pointer to the previous code point.
@@ -571,7 +571,7 @@ ecma_regexp_step_back (ecma_regexp_ctx_t *re_ctx_p, /**< regexp context */
const lit_utf8_byte_t *str_p) /**< reference to string pointer */
{
JERRY_ASSERT (str_p != NULL);
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
lit_code_point_t ch = lit_cesu8_read_prev (&str_p);
if (JERRY_UNLIKELY (re_ctx_p->flags & RE_FLAG_UNICODE)
&& lit_is_code_point_utf16_low_surrogate (ch)
@@ -579,10 +579,10 @@ ecma_regexp_step_back (ecma_regexp_ctx_t *re_ctx_p, /**< regexp context */
{
str_p -= LIT_UTF8_MAX_BYTES_IN_CODE_UNIT;
}
#else /* !ENABLED (JERRY_ES2015) */
#else /* !ENABLED (JERRY_ESNEXT) */
JERRY_UNUSED (re_ctx_p);
lit_utf8_decr (&str_p);
#endif /* !ENABLED (JERRY_ES2015) */
#endif /* !ENABLED (JERRY_ESNEXT) */
return str_p;
} /* ecma_regexp_step_back */
@@ -1450,7 +1450,7 @@ class_found:
bc_p = bc_p + escape_count + chars_size + ranges_size;
continue;
}
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
case RE_OP_UNICODE_PERIOD:
{
if (str_curr_p >= re_ctx_p->input_end_p)
@@ -1467,7 +1467,7 @@ class_found:
continue;
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
case RE_OP_PERIOD:
{
if (str_curr_p >= re_ctx_p->input_end_p)
@@ -1709,11 +1709,11 @@ ecma_regexp_exec_helper (ecma_object_t *regexp_object_p, /**< RegExp object */
/* TODO: Replace with ToLength */
if (lastindex_num < 0.0f)
{
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
lastindex_num = 0.0f;
#else /* !ENABLED (JERRY_ES2015) */
#else /* !ENABLED (JERRY_ESNEXT) */
lastindex_num = input_length + 1;
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
}
index = ecma_number_to_uint32 (lastindex_num);
@@ -1771,7 +1771,7 @@ ecma_regexp_exec_helper (ecma_object_t *regexp_object_p, /**< RegExp object */
break;
}
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
if (re_ctx.flags & RE_FLAG_STICKY)
{
ecma_value_t put_result = ecma_op_object_put (regexp_object_p,
@@ -1788,7 +1788,7 @@ ecma_regexp_exec_helper (ecma_object_t *regexp_object_p, /**< RegExp object */
ret_value = ECMA_VALUE_NULL;
goto cleanup_context;
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
if (input_curr_p >= input_end_p)
{
@@ -1814,7 +1814,7 @@ ecma_regexp_exec_helper (ecma_object_t *regexp_object_p, /**< RegExp object */
JERRY_ASSERT (input_curr_p < input_end_p);
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
if (re_ctx.flags & RE_FLAG_UNICODE)
{
index++;
@@ -1828,7 +1828,7 @@ ecma_regexp_exec_helper (ecma_object_t *regexp_object_p, /**< RegExp object */
continue;
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
index++;
lit_utf8_incr (&input_curr_p);
@@ -2007,7 +2007,7 @@ ecma_regexp_split_helper (ecma_value_t this_arg, /**< this value */
ecma_value_t string_arg, /**< string value */
ecma_value_t limit_arg) /**< limit value */
{
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
/* 2. */
if (!ecma_is_value_object (this_arg))
{
@@ -2311,7 +2311,7 @@ cleanup_string:
ecma_deref_ecma_string (string_p);
return result;
#else /* ENABLED (JERRY_ES2015) */
#else /* ENABLED (JERRY_ESNEXT) */
ecma_value_t result = ECMA_VALUE_ERROR;
/* 2. */
@@ -2480,7 +2480,7 @@ cleanup_string:
ecma_deref_ecma_string (string_p);
return result;
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
} /* ecma_regexp_split_helper */
/**
@@ -2523,7 +2523,7 @@ ecma_regexp_replace_helper_fast (ecma_replace_context_t *ctx_p, /**<replace cont
const lit_utf8_byte_t *last_append_p = current_p;
JERRY_ASSERT (ctx_p->index <= string_length);
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
/* Global matches always start at index 0, but Sticky matches may have a non-zero lastIndex. */
if (ctx_p->index > 0)
{
@@ -2540,7 +2540,7 @@ ecma_regexp_replace_helper_fast (ecma_replace_context_t *ctx_p, /**<replace cont
}
}
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
ecma_regexp_ctx_t re_ctx;
ecma_regexp_initialize_context (&re_ctx,
@@ -2639,7 +2639,7 @@ ecma_regexp_replace_helper_fast (ecma_replace_context_t *ctx_p, /**<replace cont
break;
}
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
if ((re_ctx.flags & RE_FLAG_UNICODE) != 0)
{
ctx_p->index++;
@@ -2653,7 +2653,7 @@ ecma_regexp_replace_helper_fast (ecma_replace_context_t *ctx_p, /**<replace cont
continue;
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
ctx_p->index++;
lit_utf8_incr (&current_p);
@@ -2736,15 +2736,15 @@ ecma_regexp_replace_helper (ecma_value_t this_arg, /**< this argument */
const bool global = ecma_op_to_boolean (result);
ecma_free_value (result);
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
const lit_utf8_size_t string_length = ecma_string_get_length (string_p);
bool unicode = false;
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/* 10. */
if (global)
{
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
result = ecma_op_object_get_by_magic_id (this_obj_p, LIT_MAGIC_STRING_UNICODE);
if (ECMA_IS_VALUE_ERROR (result))
{
@@ -2753,7 +2753,7 @@ ecma_regexp_replace_helper (ecma_value_t this_arg, /**< this argument */
unicode = ecma_op_to_boolean (result);
ecma_free_value (result);
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
result = ecma_op_object_put (this_obj_p,
ecma_get_magic_string (LIT_MAGIC_STRING_LASTINDEX_UL),
@@ -2767,7 +2767,7 @@ ecma_regexp_replace_helper (ecma_value_t this_arg, /**< this argument */
JERRY_ASSERT (ecma_is_value_boolean (result));
}
#if !ENABLED (JERRY_ES2015)
#if !ENABLED (JERRY_ESNEXT)
ecma_extended_object_t *re_obj_p = (ecma_extended_object_t *) this_obj_p;
const re_compiled_code_t *bc_p = ECMA_GET_INTERNAL_VALUE_POINTER (re_compiled_code_t,
re_obj_p->u.class_prop.u.value);
@@ -2778,7 +2778,7 @@ ecma_regexp_replace_helper (ecma_value_t this_arg, /**< this argument */
replace_arg);
goto cleanup_replace;
#else /* ENABLED (JERRY_ES2015) */
#else /* ENABLED (JERRY_ESNEXT) */
result = ecma_op_object_get_by_magic_id (this_obj_p, LIT_MAGIC_STRING_EXEC);
if (ECMA_IS_VALUE_ERROR (result))
@@ -3190,7 +3190,7 @@ cleanup_chars:
cleanup_results:
ecma_collection_free (results_p);
#endif /* !ENABLED (JERRY_ES2015) */
#endif /* !ENABLED (JERRY_ESNEXT) */
cleanup_replace:
if (replace_ctx.replace_str_p != NULL)
@@ -3250,7 +3250,7 @@ ecma_regexp_match_helper (ecma_value_t this_arg, /**< this argument */
return result;
}
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
ecma_value_t full_unicode_value = ecma_op_object_get_by_magic_id (obj_p, LIT_MAGIC_STRING_UNICODE);
if (ECMA_IS_VALUE_ERROR (full_unicode_value))
@@ -3262,7 +3262,7 @@ ecma_regexp_match_helper (ecma_value_t this_arg, /**< this argument */
bool full_unicode = ecma_op_to_boolean (full_unicode_value);
ecma_free_value (full_unicode_value);
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
ecma_value_t set_status = ecma_op_object_put (obj_p,
ecma_get_magic_string (LIT_MAGIC_STRING_LASTINDEX_UL),
@@ -3336,7 +3336,7 @@ ecma_regexp_match_helper (ecma_value_t this_arg, /**< this argument */
goto match_cleanup;
}
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
uint32_t index;
ecma_value_t length_value = ecma_op_to_length (this_index, &index);
@@ -3353,7 +3353,7 @@ ecma_regexp_match_helper (ecma_value_t this_arg, /**< this argument */
ecma_get_magic_string (LIT_MAGIC_STRING_LASTINDEX_UL),
ecma_make_uint32_value (next_index),
true);
#else /* !ENABLED (JERRY_ES2015) */
#else /* !ENABLED (JERRY_ESNEXT) */
ecma_number_t next_index = ecma_get_number_from_value (this_index);
ecma_value_t next_set_status = ecma_op_object_put (obj_p,
@@ -3362,7 +3362,7 @@ ecma_regexp_match_helper (ecma_value_t this_arg, /**< this argument */
true);
ecma_free_value (this_index);
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
if (ECMA_IS_VALUE_ERROR (next_set_status))
{
@@ -3405,7 +3405,7 @@ ecma_op_regexp_exec (ecma_value_t this_arg, /**< this argument */
{
ecma_object_t *arg_obj_p = ecma_get_object_from_value (this_arg);
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
ecma_value_t exec = ecma_op_object_get_by_magic_id (arg_obj_p, LIT_MAGIC_STRING_EXEC);
if (ECMA_IS_VALUE_ERROR (exec))
@@ -3439,7 +3439,7 @@ ecma_op_regexp_exec (ecma_value_t this_arg, /**< this argument */
{
ecma_free_value (exec);
}
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
if (!ecma_object_is_regexp_object (this_arg))
{
@@ -148,9 +148,9 @@ typedef struct
uint8_t char_size; /**< size of encoded characters */
} ecma_regexp_ctx_t;
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
lit_code_point_t ecma_regexp_unicode_advance (const lit_utf8_byte_t **str_p, const lit_utf8_byte_t *end_p);
#endif /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
ecma_object_t *ecma_op_regexp_alloc (ecma_object_t *new_target_obj_p);
ecma_value_t ecma_regexp_exec_helper (ecma_object_t *regexp_object_p,
@@ -24,7 +24,7 @@
#include "ecma-symbol-object.h"
#include "lit-char-helpers.h"
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
/** \addtogroup ecma ECMA
* @{
@@ -173,7 +173,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 /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/**
* @}
@@ -16,7 +16,7 @@
#ifndef ECMA_SYMBOL_H
#define ECMA_SYMBOL_H
#if ENABLED (JERRY_ES2015)
#if ENABLED (JERRY_ESNEXT)
#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 /* ENABLED (JERRY_ES2015) */
#endif /* ENABLED (JERRY_ESNEXT) */
/**
* @}
* @}
@@ -29,7 +29,7 @@
#include "ecma-helpers.h"
#include "jcontext.h"
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
/** \addtogroup ecma ECMA
* @{
@@ -1378,4 +1378,4 @@ ecma_typedarray_get_info (ecma_object_t *typedarray_p)
* @}
* @}
*/
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
@@ -19,7 +19,7 @@
#include "ecma-globals.h"
#include "ecma-builtins.h"
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
#if ENABLED (JERRY_BUILTIN_TYPEDARRAY)
/** \addtogroup ecma ECMA
* @{
@@ -79,5 +79,5 @@ ecma_value_t ecma_typedarray_create_object_with_length (ecma_length_t array_leng
* @}
*/
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
#endif /* ENABLED (JERRY_BUILTIN_TYPEDARRAY) */
#endif /* !ECMA_TYPEDARRAY_OBJECT_H */