1425bb815Sopenharmony_ci/* Copyright JS Foundation and other contributors, http://js.foundation 2425bb815Sopenharmony_ci * 3425bb815Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4425bb815Sopenharmony_ci * you may not use this file except in compliance with the License. 5425bb815Sopenharmony_ci * You may obtain a copy of the License at 6425bb815Sopenharmony_ci * 7425bb815Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8425bb815Sopenharmony_ci * 9425bb815Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10425bb815Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS 11425bb815Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12425bb815Sopenharmony_ci * See the License for the specific language governing permissions and 13425bb815Sopenharmony_ci * limitations under the License. 14425bb815Sopenharmony_ci */ 15425bb815Sopenharmony_ci 16425bb815Sopenharmony_ci#ifndef ECMA_FUNCTION_OBJECT_H 17425bb815Sopenharmony_ci#define ECMA_FUNCTION_OBJECT_H 18425bb815Sopenharmony_ci 19425bb815Sopenharmony_ci#include "ecma-globals.h" 20425bb815Sopenharmony_ci#include "ecma-builtins.h" 21425bb815Sopenharmony_ci#include "vm.h" 22425bb815Sopenharmony_ci 23425bb815Sopenharmony_ci/** \addtogroup ecma ECMA 24425bb815Sopenharmony_ci * @{ 25425bb815Sopenharmony_ci * 26425bb815Sopenharmony_ci * \addtogroup ecmafunctionobject ECMA Function object related routines 27425bb815Sopenharmony_ci * @{ 28425bb815Sopenharmony_ci */ 29425bb815Sopenharmony_ci 30425bb815Sopenharmony_ci#if ENABLED (JERRY_LINE_INFO) || ENABLED (JERRY_ES2015_MODULE_SYSTEM) 31425bb815Sopenharmony_ciecma_value_t ecma_op_resource_name (const ecma_compiled_code_t *bytecode_header_p); 32425bb815Sopenharmony_ci#endif /* ENABLED (JERRY_LINE_INFO) || ENABLED (JERRY_ES2015_MODULE_SYSTEM) */ 33425bb815Sopenharmony_ci 34425bb815Sopenharmony_cibool ecma_op_is_callable (ecma_value_t value); 35425bb815Sopenharmony_cibool ecma_op_object_is_callable (ecma_object_t *obj_p); 36425bb815Sopenharmony_cibool ecma_is_constructor (ecma_value_t value); 37425bb815Sopenharmony_cibool ecma_object_is_constructor (ecma_object_t *obj_p); 38425bb815Sopenharmony_ci 39425bb815Sopenharmony_ciecma_object_t * 40425bb815Sopenharmony_ciecma_op_create_simple_function_object (ecma_object_t *scope_p, const ecma_compiled_code_t *bytecode_data_p); 41425bb815Sopenharmony_ci 42425bb815Sopenharmony_ciecma_object_t * 43425bb815Sopenharmony_ciecma_op_create_external_function_object (ecma_external_handler_t handler_cb); 44425bb815Sopenharmony_ci 45425bb815Sopenharmony_ciconst ecma_compiled_code_t * 46425bb815Sopenharmony_ciecma_op_function_get_compiled_code (ecma_extended_object_t *function_p); 47425bb815Sopenharmony_ci 48425bb815Sopenharmony_ciecma_value_t 49425bb815Sopenharmony_ciecma_op_create_dynamic_function (const ecma_value_t *arguments_list_p, 50425bb815Sopenharmony_ci ecma_length_t arguments_list_len, 51425bb815Sopenharmony_ci ecma_parse_opts_t opts); 52425bb815Sopenharmony_ci 53425bb815Sopenharmony_ci#if ENABLED (JERRY_ES2015) 54425bb815Sopenharmony_ciecma_value_t 55425bb815Sopenharmony_ciecma_op_function_get_super_constructor (ecma_object_t *func_obj_p); 56425bb815Sopenharmony_ci 57425bb815Sopenharmony_ciecma_object_t * 58425bb815Sopenharmony_ciecma_op_create_generator_function_object (ecma_object_t *scope_p, const ecma_compiled_code_t *bytecode_data_p); 59425bb815Sopenharmony_ci 60425bb815Sopenharmony_ciecma_object_t * 61425bb815Sopenharmony_ciecma_op_create_arrow_function_object (ecma_object_t *scope_p, const ecma_compiled_code_t *bytecode_data_p, 62425bb815Sopenharmony_ci ecma_value_t this_binding); 63425bb815Sopenharmony_cibool 64425bb815Sopenharmony_ciecma_op_function_is_generator (ecma_object_t *func_obj_p); 65425bb815Sopenharmony_ci#endif /* ENABLED (JERRY_ES2015) */ 66425bb815Sopenharmony_ci 67425bb815Sopenharmony_ciecma_object_t * 68425bb815Sopenharmony_ciecma_op_get_prototype_from_constructor (ecma_object_t *ctor_obj_p, ecma_builtin_id_t default_proto_id); 69425bb815Sopenharmony_ci 70425bb815Sopenharmony_ciecma_value_t 71425bb815Sopenharmony_ciecma_op_function_has_instance (ecma_object_t *func_obj_p, ecma_value_t value); 72425bb815Sopenharmony_ci 73425bb815Sopenharmony_ciecma_value_t 74425bb815Sopenharmony_ciecma_op_function_call (ecma_object_t *func_obj_p, ecma_value_t this_arg_value, 75425bb815Sopenharmony_ci const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len); 76425bb815Sopenharmony_ci 77425bb815Sopenharmony_ciecma_value_t 78425bb815Sopenharmony_ciecma_op_function_construct (ecma_object_t *func_obj_p, ecma_object_t *new_target_p, 79425bb815Sopenharmony_ci const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len); 80425bb815Sopenharmony_ci 81425bb815Sopenharmony_ciecma_property_t * 82425bb815Sopenharmony_ciecma_op_function_try_to_lazy_instantiate_property (ecma_object_t *object_p, ecma_string_t *property_name_p); 83425bb815Sopenharmony_ci 84425bb815Sopenharmony_ciecma_property_t * 85425bb815Sopenharmony_ciecma_op_external_function_try_to_lazy_instantiate_property (ecma_object_t *object_p, ecma_string_t *property_name_p); 86425bb815Sopenharmony_ci 87425bb815Sopenharmony_ciecma_property_t * 88425bb815Sopenharmony_ciecma_op_bound_function_try_to_lazy_instantiate_property (ecma_object_t *object_p, ecma_string_t *property_name_p); 89425bb815Sopenharmony_ci 90425bb815Sopenharmony_civoid 91425bb815Sopenharmony_ciecma_op_function_list_lazy_property_names (ecma_object_t *object_p, 92425bb815Sopenharmony_ci uint32_t opts, 93425bb815Sopenharmony_ci ecma_collection_t *main_collection_p, 94425bb815Sopenharmony_ci ecma_collection_t *non_enum_collection_p); 95425bb815Sopenharmony_ci 96425bb815Sopenharmony_civoid 97425bb815Sopenharmony_ciecma_op_external_function_list_lazy_property_names (ecma_object_t *object_p, 98425bb815Sopenharmony_ci uint32_t opts, 99425bb815Sopenharmony_ci ecma_collection_t *main_collection_p, 100425bb815Sopenharmony_ci ecma_collection_t *non_enum_collection_p); 101425bb815Sopenharmony_ci 102425bb815Sopenharmony_civoid 103425bb815Sopenharmony_ciecma_op_bound_function_list_lazy_property_names (ecma_object_t *object_p, 104425bb815Sopenharmony_ci uint32_t opts, 105425bb815Sopenharmony_ci ecma_collection_t *main_collection_p, 106425bb815Sopenharmony_ci ecma_collection_t *non_enum_collection_p); 107425bb815Sopenharmony_ci 108425bb815Sopenharmony_ci/** 109425bb815Sopenharmony_ci * @} 110425bb815Sopenharmony_ci * @} 111425bb815Sopenharmony_ci */ 112425bb815Sopenharmony_ci 113425bb815Sopenharmony_ci#endif /* !ECMA_FUNCTION_OBJECT_H */ 114