1 /* Copyright JS Foundation and other contributors, http://js.foundation 2 * 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 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 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. 14 */ 15 16 #include "ecma-builtins.h" 17 #include "ecma-exceptions.h" 18 #include "ecma-dataview-object.h" 19 20 #if ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW) 21 22 #define ECMA_BUILTINS_INTERNAL 23 #include "ecma-builtins-internal.h" 24 25 #define BUILTIN_INC_HEADER_NAME "ecma-builtin-dataview.inc.h" 26 #define BUILTIN_UNDERSCORED_ID dataview 27 #include "ecma-builtin-internal-routines-template.inc.h" 28 29 /** \addtogroup ecma ECMA 30 * @{ 31 * 32 * \addtogroup ecmabuiltins 33 * @{ 34 * 35 * \addtogroup dataview ECMA DataView object built-in 36 * @{ 37 */ 38 39 /** 40 * Handle calling [[Call]] of built-in DataView object 41 * 42 * @return ecma value 43 */ 44 ecma_value_t ecma_builtin_dataview_dispatch_call(const ecma_value_t * arguments_list_p,ecma_length_t arguments_list_len)45ecma_builtin_dataview_dispatch_call (const ecma_value_t *arguments_list_p, /**< arguments list */ 46 ecma_length_t arguments_list_len) /**< number of arguments */ 47 { 48 JERRY_ASSERT (arguments_list_len == 0 || arguments_list_p != NULL); 49 50 return ecma_raise_type_error (ECMA_ERR_MSG ("Constructor DataView requires 'new'.")); 51 } /* ecma_builtin_dataview_dispatch_call */ 52 53 /** 54 * Handle calling [[Construct]] of built-in DataView object 55 * 56 * @return ecma value 57 */ 58 ecma_value_t ecma_builtin_dataview_dispatch_construct(const ecma_value_t * arguments_list_p,ecma_length_t arguments_list_len)59ecma_builtin_dataview_dispatch_construct (const ecma_value_t *arguments_list_p, /**< arguments list */ 60 ecma_length_t arguments_list_len) /**< number of arguments */ 61 { 62 return ecma_op_dataview_create (arguments_list_p, arguments_list_len); 63 } /* ecma_builtin_dataview_dispatch_construct */ 64 65 /** 66 * @} 67 * @} 68 * @} 69 */ 70 71 #endif /* ENABLED (JERRY_ES2015_BUILTIN_DATAVIEW */ 72