Add custom dispatcher to builtin-iterator-prototype (#4716)
JerryScript-DCO-1.0-Signed-off-by: Orkenyi Virag orkvi@inf.u-szeged.hu
This commit is contained in:
@@ -22,6 +22,20 @@
|
|||||||
#define ECMA_BUILTINS_INTERNAL
|
#define ECMA_BUILTINS_INTERNAL
|
||||||
#include "ecma-builtins-internal.h"
|
#include "ecma-builtins-internal.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This object has a custom dispatch function.
|
||||||
|
*/
|
||||||
|
#define BUILTIN_CUSTOM_DISPATCH
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of built-in routine identifiers.
|
||||||
|
*/
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
ECMA_BUILTIN_ITERATOR_PROTOTYPE_ROUTINE_START = 0,
|
||||||
|
ECMA_BUILTIN_ITERATOR_PROTOTYPE_OBJECT_ITERATOR,
|
||||||
|
};
|
||||||
|
|
||||||
#define BUILTIN_INC_HEADER_NAME "ecma-builtin-iterator-prototype.inc.h"
|
#define BUILTIN_INC_HEADER_NAME "ecma-builtin-iterator-prototype.inc.h"
|
||||||
#define BUILTIN_UNDERSCORED_ID iterator_prototype
|
#define BUILTIN_UNDERSCORED_ID iterator_prototype
|
||||||
#include "ecma-builtin-internal-routines-template.inc.h"
|
#include "ecma-builtin-internal-routines-template.inc.h"
|
||||||
@@ -54,6 +68,36 @@ ecma_builtin_iterator_prototype_object_iterator (ecma_value_t this_val) /**< thi
|
|||||||
return ecma_copy_value (this_val);
|
return ecma_copy_value (this_val);
|
||||||
} /* ecma_builtin_iterator_prototype_object_iterator */
|
} /* ecma_builtin_iterator_prototype_object_iterator */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dispatcher of the built-in's routines
|
||||||
|
*
|
||||||
|
* @return ecma value
|
||||||
|
* Returned value must be freed with ecma_free_value.
|
||||||
|
*/
|
||||||
|
ecma_value_t
|
||||||
|
ecma_builtin_iterator_prototype_dispatch_routine (uint8_t builtin_routine_id, /**< built-in wide
|
||||||
|
* 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_BUILTIN_ITERATOR_PROTOTYPE_OBJECT_ITERATOR:
|
||||||
|
{
|
||||||
|
return ecma_builtin_iterator_prototype_object_iterator (this_arg);
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
JERRY_UNREACHABLE ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} /* ecma_builtin_iterator_prototype_dispatch_routine */
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
* @}
|
* @}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
/* Routine properties:
|
/* Routine properties:
|
||||||
* (property name, C routine name, arguments number or NON_FIXED, value of the routine's length property) */
|
* (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)
|
ROUTINE (LIT_GLOBAL_SYMBOL_ITERATOR, ECMA_BUILTIN_ITERATOR_PROTOTYPE_OBJECT_ITERATOR, 0, 0)
|
||||||
|
|
||||||
#endif /* JERRY_ESNEXT */
|
#endif /* JERRY_ESNEXT */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user