diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-array-iterator-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-array-iterator-prototype.c index d61797586..0521180a8 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-array-iterator-prototype.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-array-iterator-prototype.c @@ -24,6 +24,20 @@ #define ECMA_BUILTINS_INTERNAL #include "ecma-builtins-internal.h" +/** + * This object has a custom dispatch function. + */ +#define BUILTIN_CUSTOM_DISPATCH + +/** + * List of built-in routine identifiers. + */ +enum +{ + ECMA_ARRAY_ITERATOR_PROTOTYPE_ROUTINE_START = 0, + ECMA_ARRAY_ITERATOR_PROTOTYPE_OBJECT_NEXT, +}; + #define BUILTIN_INC_HEADER_NAME "ecma-builtin-array-iterator-prototype.inc.h" #define BUILTIN_UNDERSCORED_ID array_iterator_prototype #include "ecma-builtin-internal-routines-template.inc.h" @@ -182,6 +196,35 @@ ecma_builtin_array_iterator_prototype_object_next (ecma_value_t this_val) /**< t return result; } /* ecma_builtin_array_iterator_prototype_object_next */ +/** + * Dispatcher of the built-in's routines + * + * @return ecma value + * Returned value must be freed with ecma_free_value. + */ +ecma_value_t +ecma_builtin_array_iterator_prototype_dispatch_routine (uint8_t builtin_routine_id, /**< built-in routine identifier */ + ecma_value_t this_arg, /**< 'this' argument value */ + const ecma_value_t arguments_list_p[], /**< list of arguments + * passed to routine */ + uint32_t arguments_number) /**< length of arguments' list */ +{ + JERRY_UNUSED (arguments_list_p); + JERRY_UNUSED (arguments_number); + + switch (builtin_routine_id) + { + case ECMA_ARRAY_ITERATOR_PROTOTYPE_OBJECT_NEXT: + { + return ecma_builtin_array_iterator_prototype_object_next (this_arg); + } + default: + { + JERRY_UNREACHABLE (); + } + } +} /* ecma_builtin_array_iterator_prototype_dispatch_routine */ + /** * @} * @} diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-array-iterator-prototype.inc.h b/jerry-core/ecma/builtin-objects/ecma-builtin-array-iterator-prototype.inc.h index b71ccb2d3..aa4f41791 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-array-iterator-prototype.inc.h +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-array-iterator-prototype.inc.h @@ -27,7 +27,7 @@ STRING_VALUE (LIT_GLOBAL_SYMBOL_TO_STRING_TAG, /* Routine properties: * (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) +ROUTINE (LIT_MAGIC_STRING_NEXT, ECMA_ARRAY_ITERATOR_PROTOTYPE_OBJECT_NEXT, 0, 0) #endif /* JERRY_ESNEXT */