1 /* Copyright JS Foundation and other contributors, http://js.foundation
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 #include "ecma-builtins.h"
17 #include "ecma-exceptions.h"
19 #include "ecma-globals.h"
20 #include "ecma-helpers.h"
21 #include "ecma-typedarray-object.h"
24 #ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
26 #define ECMA_BUILTINS_INTERNAL
27 #include "ecma-builtins-internal.h"
29 #define BUILTIN_INC_HEADER_NAME "ecma-builtin-uint32array.inc.h"
30 #define BUILTIN_UNDERSCORED_ID uint32array
31 #include "ecma-builtin-internal-routines-template.inc.h"
33 /** \addtogroup ecma ECMA
36 * \addtogroup ecmabuiltins
39 * \addtogroup uint32array ECMA Uint32Array object built-in
44 * Handle calling [[Call]] of Uint32Array
49 ecma_builtin_uint32array_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */
50 ecma_length_t arguments_list_len) /**< number of arguments */
52 JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
54 return ecma_raise_type_error (ECMA_ERR_MSG ("Uint32Array cannot be directly called"));
55 } /* ecma_builtin_uint32array_dispatch_call */
58 * Handle calling [[Construct]] of Uint32Array
63 ecma_builtin_uint32array_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */
64 ecma_length_t arguments_list_len) /**< number of arguments */
66 JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL);
68 ecma_object_t *prototype_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_UINT32ARRAY_PROTOTYPE);
69 ecma_value_t val = ecma_op_create_typedarray (arguments_list_p,
73 LIT_MAGIC_STRING_UINT32_ARRAY_UL);
75 ecma_deref_object (prototype_obj_p);
78 } /* ecma_builtin_uint32array_dispatch_construct */
86 #endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */