|
28 | 28 | #define ECMA_BUILTINS_INTERNAL
|
29 | 29 | #include "ecma-builtins-internal.h"
|
30 | 30 |
|
| 31 | +/** |
| 32 | + * List of built-in routine identifiers. |
| 33 | + */ |
| 34 | +enum |
| 35 | +{ |
| 36 | + ECMA_ARRAYBUFFER_ROUTINE_START = 0, |
| 37 | + ECMA_ARRAYBUFFER_OBJECT_IS_VIEW, |
| 38 | + ECMA_ARRAYBUFFER_SPECIES_GET, |
| 39 | +}; |
| 40 | + |
31 | 41 | #define BUILTIN_INC_HEADER_NAME "ecma-builtin-arraybuffer.inc.h"
|
32 | 42 | #define BUILTIN_UNDERSCORED_ID arraybuffer
|
33 | 43 | #include "ecma-builtin-internal-routines-template.inc.h"
|
@@ -93,16 +103,36 @@ ecma_builtin_arraybuffer_dispatch_construct (const ecma_value_t *arguments_list_
|
93 | 103 | } /* ecma_builtin_arraybuffer_dispatch_construct */
|
94 | 104 |
|
95 | 105 | /**
|
96 |
| - * 24.1.3.3 get ArrayBuffer [ @@species ] accessor |
| 106 | + * Dispatcher of the built-in's routines |
97 | 107 | *
|
98 |
| - * @return ecma_value |
99 |
| - * returned value must be freed with ecma_free_value |
| 108 | + * @return ecma value |
| 109 | + * Returned value must be freed with ecma_free_value. |
100 | 110 | */
|
101 | 111 | ecma_value_t
|
102 |
| -ecma_builtin_arraybuffer_species_get (ecma_value_t this_value) /**< This Value */ |
| 112 | +ecma_builtin_arraybuffer_dispatch_routine (uint8_t builtin_routine_id, /**< built-in wide routine identifier */ |
| 113 | + ecma_value_t this_arg, /**< 'this' argument value */ |
| 114 | + const ecma_value_t arguments_list_p[], /**< list of arguments |
| 115 | + * passed to routine */ |
| 116 | + uint32_t arguments_number) /**< length of arguments' list */ |
103 | 117 | {
|
104 |
| - return ecma_copy_value (this_value); |
105 |
| -} /* ecma_builtin_arraybuffer_species_get */ |
| 118 | + JERRY_UNUSED (arguments_number); |
| 119 | + |
| 120 | + switch (builtin_routine_id) |
| 121 | + { |
| 122 | + case ECMA_ARRAYBUFFER_OBJECT_IS_VIEW: |
| 123 | + { |
| 124 | + return ecma_builtin_arraybuffer_object_is_view (this_arg, arguments_list_p[0]); |
| 125 | + } |
| 126 | + case ECMA_ARRAYBUFFER_SPECIES_GET: |
| 127 | + { |
| 128 | + return ecma_copy_value (this_arg); |
| 129 | + } |
| 130 | + default: |
| 131 | + { |
| 132 | + JERRY_UNREACHABLE (); |
| 133 | + } |
| 134 | + } |
| 135 | +} /* ecma_builtin_arraybuffer_dispatch_routine */ |
106 | 136 |
|
107 | 137 | /**
|
108 | 138 | * @}
|
|
0 commit comments