Skip to content

Change JERRY_ES2015_BUILTIN_ITERATOR macro to JERRY_ES2015. #3374

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions jerry-core/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,6 @@
# define JERRY_ES2015_BUILTIN_DATAVIEW JERRY_ES2015
#endif /* !defined (JERRY_ES2015_BUILTIN_DATAVIEW) */

#ifndef JERRY_ES2015_BUILTIN_ITERATOR
# define JERRY_ES2015_BUILTIN_ITERATOR JERRY_ES2015
#endif /* !defined (JERRY_ES2015_BUILTIN_ITERATOR) */

#ifndef JERRY_ES2015_BUILTIN_MAP
# define JERRY_ES2015_BUILTIN_MAP JERRY_ES2015
#endif /* !defined (JERRY_ES2015_BUILTIN_MAP) */
Expand Down Expand Up @@ -528,10 +524,6 @@
|| ((JERRY_ES2015_BUILTIN != 0) && (JERRY_ES2015_BUILTIN != 1))
# error "Invalid value for JERRY_ES2015_BUILTIN macro."
#endif
#if !defined (JERRY_ES2015_BUILTIN_ITERATOR) \
|| ((JERRY_ES2015_BUILTIN_ITERATOR != 0) && (JERRY_ES2015_BUILTIN_ITERATOR != 1))
# error "Invalid value for JERRY_ES2015_BUILTIN_ITERATOR macro."
#endif
#if !defined (JERRY_ES2015_BUILTIN_DATAVIEW) \
|| ((JERRY_ES2015_BUILTIN_DATAVIEW != 0) && (JERRY_ES2015_BUILTIN_DATAVIEW != 1))
# error "Invalid value for JERRY_ES2015_BUILTIN_DATAVIEW macro."
Expand Down
8 changes: 4 additions & 4 deletions jerry-core/ecma/base/ecma-gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
break;
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
#if ENABLED (JERRY_ES2015)
case ECMA_PSEUDO_ARRAY_ITERATOR:
case ECMA_PSEUDO_SET_ITERATOR:
case ECMA_PSEUDO_MAP_ITERATOR:
Expand All @@ -548,7 +548,7 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
{
break;
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
#endif /* ENABLED (JERRY_ES2015) */
default:
{
JERRY_ASSERT (ext_object_p->u.pseudo_array.type == ECMA_PSEUDO_ARRAY_ARGUMENTS);
Expand Down Expand Up @@ -1199,7 +1199,7 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
break;
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
#if ENABLED (JERRY_ES2015)
case ECMA_PSEUDO_STRING_ITERATOR:
{
ecma_value_t iterated_value = ext_object_p->u.pseudo_array.u2.iterated_value;
Expand All @@ -1211,7 +1211,7 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */

break;
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
#endif /* ENABLED (JERRY_ES2015) */
default:
{
JERRY_ASSERT (ext_object_p->u.pseudo_array.type == ECMA_PSEUDO_ARRAY_TYPEDARRAY
Expand Down
6 changes: 4 additions & 2 deletions jerry-core/ecma/base/ecma-globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,8 @@ typedef enum
ECMA_LEXICAL_ENVIRONMENT_TYPE__MAX = ECMA_LEXICAL_ENVIRONMENT_SUPER_OBJECT_BOUND /**< maximum value */
} ecma_lexical_environment_type_t;

#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
#if ENABLED (JERRY_ES2015)

/**
* Types of array iterators.
*/
Expand All @@ -663,7 +664,8 @@ typedef enum
ECMA_ITERATOR_VALUES, /**< List only key values */
ECMA_ITERATOR_KEYS_VALUES, /**< List key indices and values */
} ecma_iterator_type_t;
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */

#endif /* ENABLED (JERRY_ES2015) */

/**
* Offset for JERRY_CONTEXT (status_flags) top 8 bits.
Expand Down
6 changes: 4 additions & 2 deletions jerry-core/ecma/base/ecma-helpers-string.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,8 @@ ecma_new_ecma_string_from_code_unit (ecma_char_t code_unit) /**< code unit */
return ecma_new_ecma_string_from_utf8 (lit_utf8_bytes, bytes_size);
} /* ecma_new_ecma_string_from_code_unit */

#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
#if ENABLED (JERRY_ES2015)

/**
* Allocate new ecma-string and fill it with cesu-8 character which represents specified code units
*
Expand All @@ -515,7 +516,8 @@ ecma_new_ecma_string_from_code_units (ecma_char_t first_code_unit, /**< code uni

return ecma_new_ecma_string_from_utf8 (lit_utf8_bytes, bytes_size);
} /* ecma_new_ecma_string_from_code_units */
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */

#endif /* ENABLED (JERRY_ES2015) */

/**
* Allocate new ecma-string and fill it with ecma-number
Expand Down
4 changes: 2 additions & 2 deletions jerry-core/ecma/base/ecma-helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,9 @@ ecma_string_t *ecma_new_ecma_string_from_utf8 (const lit_utf8_byte_t *string_p,
ecma_string_t *ecma_new_ecma_string_from_utf8_converted_to_cesu8 (const lit_utf8_byte_t *string_p,
lit_utf8_size_t string_size);
ecma_string_t *ecma_new_ecma_string_from_code_unit (ecma_char_t code_unit);
#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
#if ENABLED (JERRY_ES2015)
ecma_string_t *ecma_new_ecma_string_from_code_units (ecma_char_t first_code_unit, ecma_char_t second_code_unit);
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
#endif /* ENABLED (JERRY_ES2015) */
ecma_string_t *ecma_new_ecma_string_from_uint32 (uint32_t uint32_number);
ecma_string_t *ecma_new_non_direct_string_from_uint32 (uint32_t uint32_number);
ecma_string_t *ecma_get_ecma_string_from_uint32 (uint32_t uint32_number);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "ecma-iterator-object.h"
#include "ecma-typedarray-object.h"

#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
#if ENABLED (JERRY_ES2015)

#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
Expand Down Expand Up @@ -172,4 +172,4 @@ ecma_builtin_array_iterator_prototype_object_next (ecma_value_t this_val) /**< t
* @}
*/

#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
#endif /* ENABLED (JERRY_ES2015) */
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include "ecma-builtin-helpers-macro-defines.inc.h"

#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
#if ENABLED (JERRY_ES2015)

STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG,
LIT_MAGIC_STRING_ARRAY_ITERATOR_UL,
Expand All @@ -29,6 +29,6 @@ STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG,
* (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
ROUTINE (LIT_MAGIC_STRING_NEXT, ecma_builtin_array_iterator_prototype_object_next, 0, 0)

#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
#endif /* ENABLED (JERRY_ES2015) */

#include "ecma-builtin-helpers-macro-undefs.inc.h"
10 changes: 6 additions & 4 deletions jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c
Original file line number Diff line number Diff line change
Expand Up @@ -2396,7 +2396,8 @@ ecma_builtin_array_prototype_object_copy_within (const ecma_value_t args[], /**<
} /* ecma_builtin_array_prototype_object_copy_within */
#endif /* ENABLED (JERRY_ES2015_BUILTIN) */

#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
#if ENABLED (JERRY_ES2015)

/**
* Helper function for Array.prototype object's {'keys', 'values', 'entries', '@@iterator'}
* routines common parts.
Expand Down Expand Up @@ -2425,7 +2426,8 @@ ecma_builtin_array_iterators_helper (ecma_object_t *obj_p, /**< array object */
ECMA_PSEUDO_ARRAY_ITERATOR,
type);
} /* ecma_builtin_array_iterators_helper */
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */

#endif /* ENABLED (JERRY_ES2015) */

/**
* Dispatcher of the built-in's routines
Expand Down Expand Up @@ -2470,7 +2472,7 @@ ecma_builtin_array_prototype_dispatch_routine (uint16_t builtin_routine_id, /**<
return ret_value;
}

#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
#if ENABLED (JERRY_ES2015)
if (JERRY_UNLIKELY (builtin_routine_id >= ECMA_ARRAY_PROTOTYPE_ENTRIES
&& builtin_routine_id <= ECMA_ARRAY_PROTOTYPE_SYMBOL_ITERATOR))
{
Expand All @@ -2495,7 +2497,7 @@ ecma_builtin_array_prototype_dispatch_routine (uint16_t builtin_routine_id, /**<
ecma_deref_object (obj_p);
return ret_value;
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
#endif /* ENABLED (JERRY_ES2015) */

uint32_t length;
ecma_value_t len_value = ecma_op_object_get_length (obj_p, &length);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ ROUTINE (LIT_MAGIC_STRING_FIND_INDEX, ECMA_ARRAY_PROTOTYPE_FIND_INDEX, 2, 1)
ROUTINE (LIT_MAGIC_STRING_FILL, ECMA_ARRAY_PROTOTYPE_FILL, 3, 1)
ROUTINE (LIT_MAGIC_STRING_COPY_WITHIN, ECMA_ARRAY_PROTOTYPE_COPY_WITHIN, NON_FIXED, 2)
#endif /* ENABLED (JERRY_ES2015_BUILTIN) */
#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
#if ENABLED (JERRY_ES2015)
ROUTINE (LIT_MAGIC_STRING_ENTRIES, ECMA_ARRAY_PROTOTYPE_ENTRIES, 0, 0)
ROUTINE (LIT_MAGIC_STRING_VALUES, ECMA_ARRAY_PROTOTYPE_VALUES, 0, 0)
ROUTINE (LIT_MAGIC_STRING_KEYS, ECMA_ARRAY_PROTOTYPE_KEYS, 0, 0)
ROUTINE (LIT_GLOBAL_SYMBOL_ITERATOR, ECMA_ARRAY_PROTOTYPE_SYMBOL_ITERATOR, 0, 0)
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
#endif /* ENABLED (JERRY_ES2015) */

#endif /* ENABLED (JERRY_BUILTIN_ARRAY) */

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "ecma-builtins.h"
#include "ecma-iterator-object.h"

#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
#if ENABLED (JERRY_ES2015)

#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
Expand Down Expand Up @@ -60,4 +60,4 @@ ecma_builtin_iterator_prototype_object_iterator (ecma_value_t this_val) /**< thi
* @}
*/

#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
#endif /* ENABLED (JERRY_ES2015) */
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@

#include "ecma-builtin-helpers-macro-defines.inc.h"

#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
#if ENABLED (JERRY_ES2015)

/* Routine properties:
* (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
ROUTINE (LIT_GLOBAL_SYMBOL_ITERATOR, ecma_builtin_iterator_prototype_object_iterator, 0, 0)

#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
#endif /* ENABLED (JERRY_ES2015) */

#include "ecma-builtin-helpers-macro-undefs.inc.h"
5 changes: 3 additions & 2 deletions jerry-core/ecma/builtin-objects/ecma-builtin-map-prototype.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ ecma_builtin_map_prototype_object_size_getter (ecma_value_t this_arg) /**< this
return ecma_op_container_size (this_arg, LIT_MAGIC_STRING_MAP_UL);
} /* ecma_builtin_map_prototype_object_size_getter */

#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
#if ENABLED (JERRY_ES2015)

/**
* The Map.prototype object's 'entries' routine
*
Expand Down Expand Up @@ -205,7 +206,7 @@ ecma_builtin_map_prototype_object_values (ecma_value_t this_arg) /**< this argum
ECMA_PSEUDO_MAP_ITERATOR);
} /* ecma_builtin_map_prototype_object_values */

#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
#endif /* ENABLED (JERRY_ES2015) */

/**
* @}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ ROUTINE (LIT_MAGIC_STRING_FOR_EACH_UL, ecma_builtin_map_prototype_object_foreach
ROUTINE (LIT_MAGIC_STRING_GET, ecma_builtin_map_prototype_object_get, 1, 1)
ROUTINE (LIT_MAGIC_STRING_HAS, ecma_builtin_map_prototype_object_has, 1, 1)
ROUTINE (LIT_MAGIC_STRING_SET, ecma_builtin_map_prototype_object_set, 2, 2)
#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
#if ENABLED (JERRY_ES2015)
ROUTINE (LIT_MAGIC_STRING_ENTRIES, ecma_builtin_map_prototype_object_entries, 0, 0)
ROUTINE (LIT_MAGIC_STRING_VALUES, ecma_builtin_map_prototype_object_values, 0, 0)
ROUTINE (LIT_MAGIC_STRING_KEYS, ecma_builtin_map_prototype_object_keys, 0, 0)
ROUTINE (LIT_GLOBAL_SYMBOL_ITERATOR, ecma_builtin_map_prototype_object_values, 0, 0)
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
#endif /* ENABLED (JERRY_ES2015) */

/* ECMA-262 v6, 23.1.3.10 */
ACCESSOR_READ_ONLY (LIT_MAGIC_STRING_SIZE,
Expand Down
5 changes: 3 additions & 2 deletions jerry-core/ecma/builtin-objects/ecma-builtin-set-prototype.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ ecma_builtin_set_prototype_object_size_getter (ecma_value_t this_arg) /**< this
return ecma_op_container_size (this_arg, LIT_MAGIC_STRING_SET_UL);
} /* ecma_builtin_set_prototype_object_size_getter */

#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
#if ENABLED (JERRY_ES2015)

/**
* The Set.prototype object's 'entries' routine
*
Expand Down Expand Up @@ -188,7 +189,7 @@ ecma_builtin_set_prototype_object_values (ecma_value_t this_arg) /**< this argum
ECMA_PSEUDO_SET_ITERATOR);
} /* ecma_builtin_set_prototype_object_values */

#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
#endif /* ENABLED (JERRY_ES2015) */

/**
* @}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ ROUTINE (LIT_MAGIC_STRING_CLEAR, ecma_builtin_set_prototype_object_clear, 0, 0)
ROUTINE (LIT_MAGIC_STRING_DELETE, ecma_builtin_set_prototype_object_delete, 1, 1)
ROUTINE (LIT_MAGIC_STRING_FOR_EACH_UL, ecma_builtin_set_prototype_object_foreach, 2, 1)
ROUTINE (LIT_MAGIC_STRING_HAS, ecma_builtin_set_prototype_object_has, 1, 1)
#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
#if ENABLED (JERRY_ES2015)
ROUTINE (LIT_MAGIC_STRING_ENTRIES, ecma_builtin_set_prototype_object_entries, 0, 0)
ROUTINE (LIT_MAGIC_STRING_VALUES, ecma_builtin_set_prototype_object_values, 0, 0)
ROUTINE (LIT_MAGIC_STRING_KEYS, ecma_builtin_set_prototype_object_keys, 0, 0)
ROUTINE (LIT_GLOBAL_SYMBOL_ITERATOR, ecma_builtin_set_prototype_object_values, 0, 0)
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
#endif /* ENABLED (JERRY_ES2015) */

ACCESSOR_READ_ONLY (LIT_MAGIC_STRING_SIZE,
ecma_builtin_set_prototype_object_size_getter,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "ecma-builtins.h"
#include "ecma-iterator-object.h"

#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
#if ENABLED (JERRY_ES2015)

#define ECMA_BUILTINS_INTERNAL
#include "ecma-builtins-internal.h"
Expand Down Expand Up @@ -145,4 +145,4 @@ ecma_builtin_string_iterator_prototype_object_next (ecma_value_t this_val) /**<
* @}
*/

#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
#endif /* ENABLED (JERRY_ES2015) */
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include "ecma-builtin-helpers-macro-defines.inc.h"

#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
#if ENABLED (JERRY_ES2015)

STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG,
LIT_MAGIC_STRING_STRING_ITERATOR_UL,
Expand All @@ -29,6 +29,6 @@ STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG,
* (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
ROUTINE (LIT_MAGIC_STRING_NEXT, ecma_builtin_string_iterator_prototype_object_next, 0, 0)

#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
#endif /* ENABLED (JERRY_ES2015) */

#include "ecma-builtin-helpers-macro-undefs.inc.h"
10 changes: 6 additions & 4 deletions jerry-core/ecma/builtin-objects/ecma-builtin-string-prototype.c
Original file line number Diff line number Diff line change
Expand Up @@ -1512,7 +1512,8 @@ ecma_builtin_string_prototype_object_substr (ecma_string_t *this_string_p, /**<

#endif /* ENABLED (JERRY_BUILTIN_ANNEXB) */

#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
#if ENABLED (JERRY_ES2015)

/**
* The String.prototype object's @@iterator routine
*
Expand All @@ -1530,7 +1531,8 @@ ecma_builtin_string_prototype_object_iterator (ecma_value_t to_string) /**< this
ECMA_PSEUDO_STRING_ITERATOR,
0);
} /* ecma_builtin_string_prototype_object_iterator */
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */

#endif /* ENABLED (JERRY_ES2015) */

/**
* Dispatcher of the built-in's routines
Expand Down Expand Up @@ -1668,13 +1670,13 @@ ecma_builtin_string_prototype_dispatch_routine (uint16_t builtin_routine_id, /**
break;
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN) */
#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
#if ENABLED (JERRY_ES2015)
case ECMA_STRING_PROTOTYPE_ITERATOR:
{
ret_value = ecma_builtin_string_prototype_object_iterator (to_string_val);
break;
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
#endif /* ENABLED (JERRY_ES2015) */
default:
{
JERRY_UNREACHABLE ();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ ROUTINE (LIT_MAGIC_STRING_ENDS_WITH, ECMA_STRING_PROTOTYPE_ENDS_WITH, 2, 1)
ROUTINE (LIT_MAGIC_STRING_CODE_POINT_AT, ECMA_STRING_PROTOTYPE_CODE_POINT_AT, 1, 1)
#endif /* ENABLED (JERRY_ES2015_BUILTIN) */

#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
#if ENABLED (JERRY_ES2015)
ROUTINE (LIT_GLOBAL_SYMBOL_ITERATOR, ECMA_STRING_PROTOTYPE_ITERATOR, 0, 0)
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
#endif /* ENABLED (JERRY_ES2015) */

#endif /* ENABLED (JERRY_BUILTIN_STRING) */

Expand Down
Loading