Skip to content

Commit f41afeb

Browse files
zherczegdbatyai
authored andcommitted
Change JERRY_ES2015_BUILTIN_ITERATOR macro to JERRY_ES2015. (#3374)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg [email protected]
1 parent 110f75c commit f41afeb

28 files changed

+104
-106
lines changed

jerry-core/config.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,6 @@
8787
# define JERRY_ES2015_BUILTIN_DATAVIEW JERRY_ES2015
8888
#endif /* !defined (JERRY_ES2015_BUILTIN_DATAVIEW) */
8989

90-
#ifndef JERRY_ES2015_BUILTIN_ITERATOR
91-
# define JERRY_ES2015_BUILTIN_ITERATOR JERRY_ES2015
92-
#endif /* !defined (JERRY_ES2015_BUILTIN_ITERATOR) */
93-
9490
#ifndef JERRY_ES2015_BUILTIN_MAP
9591
# define JERRY_ES2015_BUILTIN_MAP JERRY_ES2015
9692
#endif /* !defined (JERRY_ES2015_BUILTIN_MAP) */
@@ -528,10 +524,6 @@
528524
|| ((JERRY_ES2015_BUILTIN != 0) && (JERRY_ES2015_BUILTIN != 1))
529525
# error "Invalid value for JERRY_ES2015_BUILTIN macro."
530526
#endif
531-
#if !defined (JERRY_ES2015_BUILTIN_ITERATOR) \
532-
|| ((JERRY_ES2015_BUILTIN_ITERATOR != 0) && (JERRY_ES2015_BUILTIN_ITERATOR != 1))
533-
# error "Invalid value for JERRY_ES2015_BUILTIN_ITERATOR macro."
534-
#endif
535527
#if !defined (JERRY_ES2015_BUILTIN_DATAVIEW) \
536528
|| ((JERRY_ES2015_BUILTIN_DATAVIEW != 0) && (JERRY_ES2015_BUILTIN_DATAVIEW != 1))
537529
# error "Invalid value for JERRY_ES2015_BUILTIN_DATAVIEW macro."

jerry-core/ecma/base/ecma-gc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
532532
break;
533533
}
534534
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
535-
#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
535+
#if ENABLED (JERRY_ES2015)
536536
case ECMA_PSEUDO_ARRAY_ITERATOR:
537537
case ECMA_PSEUDO_SET_ITERATOR:
538538
case ECMA_PSEUDO_MAP_ITERATOR:
@@ -548,7 +548,7 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
548548
{
549549
break;
550550
}
551-
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
551+
#endif /* ENABLED (JERRY_ES2015) */
552552
default:
553553
{
554554
JERRY_ASSERT (ext_object_p->u.pseudo_array.type == ECMA_PSEUDO_ARRAY_ARGUMENTS);
@@ -1199,7 +1199,7 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
11991199
break;
12001200
}
12011201
#endif /* ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY) */
1202-
#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
1202+
#if ENABLED (JERRY_ES2015)
12031203
case ECMA_PSEUDO_STRING_ITERATOR:
12041204
{
12051205
ecma_value_t iterated_value = ext_object_p->u.pseudo_array.u2.iterated_value;
@@ -1211,7 +1211,7 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
12111211

12121212
break;
12131213
}
1214-
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
1214+
#endif /* ENABLED (JERRY_ES2015) */
12151215
default:
12161216
{
12171217
JERRY_ASSERT (ext_object_p->u.pseudo_array.type == ECMA_PSEUDO_ARRAY_TYPEDARRAY

jerry-core/ecma/base/ecma-globals.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,8 @@ typedef enum
653653
ECMA_LEXICAL_ENVIRONMENT_TYPE__MAX = ECMA_LEXICAL_ENVIRONMENT_SUPER_OBJECT_BOUND /**< maximum value */
654654
} ecma_lexical_environment_type_t;
655655

656-
#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
656+
#if ENABLED (JERRY_ES2015)
657+
657658
/**
658659
* Types of array iterators.
659660
*/
@@ -663,7 +664,8 @@ typedef enum
663664
ECMA_ITERATOR_VALUES, /**< List only key values */
664665
ECMA_ITERATOR_KEYS_VALUES, /**< List key indices and values */
665666
} ecma_iterator_type_t;
666-
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
667+
668+
#endif /* ENABLED (JERRY_ES2015) */
667669

668670
/**
669671
* Offset for JERRY_CONTEXT (status_flags) top 8 bits.

jerry-core/ecma/base/ecma-helpers-string.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,8 @@ ecma_new_ecma_string_from_code_unit (ecma_char_t code_unit) /**< code unit */
499499
return ecma_new_ecma_string_from_utf8 (lit_utf8_bytes, bytes_size);
500500
} /* ecma_new_ecma_string_from_code_unit */
501501

502-
#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
502+
#if ENABLED (JERRY_ES2015)
503+
503504
/**
504505
* Allocate new ecma-string and fill it with cesu-8 character which represents specified code units
505506
*
@@ -515,7 +516,8 @@ ecma_new_ecma_string_from_code_units (ecma_char_t first_code_unit, /**< code uni
515516

516517
return ecma_new_ecma_string_from_utf8 (lit_utf8_bytes, bytes_size);
517518
} /* ecma_new_ecma_string_from_code_units */
518-
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
519+
520+
#endif /* ENABLED (JERRY_ES2015) */
519521

520522
/**
521523
* Allocate new ecma-string and fill it with ecma-number

jerry-core/ecma/base/ecma-helpers.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,9 @@ ecma_string_t *ecma_new_ecma_string_from_utf8 (const lit_utf8_byte_t *string_p,
243243
ecma_string_t *ecma_new_ecma_string_from_utf8_converted_to_cesu8 (const lit_utf8_byte_t *string_p,
244244
lit_utf8_size_t string_size);
245245
ecma_string_t *ecma_new_ecma_string_from_code_unit (ecma_char_t code_unit);
246-
#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
246+
#if ENABLED (JERRY_ES2015)
247247
ecma_string_t *ecma_new_ecma_string_from_code_units (ecma_char_t first_code_unit, ecma_char_t second_code_unit);
248-
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
248+
#endif /* ENABLED (JERRY_ES2015) */
249249
ecma_string_t *ecma_new_ecma_string_from_uint32 (uint32_t uint32_number);
250250
ecma_string_t *ecma_new_non_direct_string_from_uint32 (uint32_t uint32_number);
251251
ecma_string_t *ecma_get_ecma_string_from_uint32 (uint32_t uint32_number);

jerry-core/ecma/builtin-objects/ecma-builtin-array-iterator-prototype.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include "ecma-iterator-object.h"
1919
#include "ecma-typedarray-object.h"
2020

21-
#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
21+
#if ENABLED (JERRY_ES2015)
2222

2323
#define ECMA_BUILTINS_INTERNAL
2424
#include "ecma-builtins-internal.h"
@@ -172,4 +172,4 @@ ecma_builtin_array_iterator_prototype_object_next (ecma_value_t this_val) /**< t
172172
* @}
173173
*/
174174

175-
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
175+
#endif /* ENABLED (JERRY_ES2015) */

jerry-core/ecma/builtin-objects/ecma-builtin-array-iterator-prototype.inc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

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

22-
#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
22+
#if ENABLED (JERRY_ES2015)
2323

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

32-
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
32+
#endif /* ENABLED (JERRY_ES2015) */
3333

3434
#include "ecma-builtin-helpers-macro-undefs.inc.h"

jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2396,7 +2396,8 @@ ecma_builtin_array_prototype_object_copy_within (const ecma_value_t args[], /**<
23962396
} /* ecma_builtin_array_prototype_object_copy_within */
23972397
#endif /* ENABLED (JERRY_ES2015_BUILTIN) */
23982398

2399-
#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
2399+
#if ENABLED (JERRY_ES2015)
2400+
24002401
/**
24012402
* Helper function for Array.prototype object's {'keys', 'values', 'entries', '@@iterator'}
24022403
* routines common parts.
@@ -2425,7 +2426,8 @@ ecma_builtin_array_iterators_helper (ecma_object_t *obj_p, /**< array object */
24252426
ECMA_PSEUDO_ARRAY_ITERATOR,
24262427
type);
24272428
} /* ecma_builtin_array_iterators_helper */
2428-
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
2429+
2430+
#endif /* ENABLED (JERRY_ES2015) */
24292431

24302432
/**
24312433
* Dispatcher of the built-in's routines
@@ -2470,7 +2472,7 @@ ecma_builtin_array_prototype_dispatch_routine (uint16_t builtin_routine_id, /**<
24702472
return ret_value;
24712473
}
24722474

2473-
#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
2475+
#if ENABLED (JERRY_ES2015)
24742476
if (JERRY_UNLIKELY (builtin_routine_id >= ECMA_ARRAY_PROTOTYPE_ENTRIES
24752477
&& builtin_routine_id <= ECMA_ARRAY_PROTOTYPE_SYMBOL_ITERATOR))
24762478
{
@@ -2495,7 +2497,7 @@ ecma_builtin_array_prototype_dispatch_routine (uint16_t builtin_routine_id, /**<
24952497
ecma_deref_object (obj_p);
24962498
return ret_value;
24972499
}
2498-
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
2500+
#endif /* ENABLED (JERRY_ES2015) */
24992501

25002502
uint32_t length;
25012503
ecma_value_t len_value = ecma_op_object_get_length (obj_p, &length);

jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.inc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ ROUTINE (LIT_MAGIC_STRING_FIND_INDEX, ECMA_ARRAY_PROTOTYPE_FIND_INDEX, 2, 1)
6868
ROUTINE (LIT_MAGIC_STRING_FILL, ECMA_ARRAY_PROTOTYPE_FILL, 3, 1)
6969
ROUTINE (LIT_MAGIC_STRING_COPY_WITHIN, ECMA_ARRAY_PROTOTYPE_COPY_WITHIN, NON_FIXED, 2)
7070
#endif /* ENABLED (JERRY_ES2015_BUILTIN) */
71-
#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
71+
#if ENABLED (JERRY_ES2015)
7272
ROUTINE (LIT_MAGIC_STRING_ENTRIES, ECMA_ARRAY_PROTOTYPE_ENTRIES, 0, 0)
7373
ROUTINE (LIT_MAGIC_STRING_VALUES, ECMA_ARRAY_PROTOTYPE_VALUES, 0, 0)
7474
ROUTINE (LIT_MAGIC_STRING_KEYS, ECMA_ARRAY_PROTOTYPE_KEYS, 0, 0)
7575
ROUTINE (LIT_GLOBAL_SYMBOL_ITERATOR, ECMA_ARRAY_PROTOTYPE_SYMBOL_ITERATOR, 0, 0)
76-
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
76+
#endif /* ENABLED (JERRY_ES2015) */
7777

7878
#endif /* ENABLED (JERRY_BUILTIN_ARRAY) */
7979

jerry-core/ecma/builtin-objects/ecma-builtin-iterator-prototype.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include "ecma-builtins.h"
1818
#include "ecma-iterator-object.h"
1919

20-
#if ENABLED (JERRY_ES2015_BUILTIN_ITERATOR)
20+
#if ENABLED (JERRY_ES2015)
2121

2222
#define ECMA_BUILTINS_INTERNAL
2323
#include "ecma-builtins-internal.h"
@@ -60,4 +60,4 @@ ecma_builtin_iterator_prototype_object_iterator (ecma_value_t this_val) /**< thi
6060
* @}
6161
*/
6262

63-
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
63+
#endif /* ENABLED (JERRY_ES2015) */

0 commit comments

Comments
 (0)