aboutsummaryrefslogtreecommitdiff
path: root/jerry-core/ecma/base/ecma-globals.h
diff options
context:
space:
mode:
authorZoltan Herczeg <zherczeg.u-szeged@partner.samsung.com>2021-02-17 17:52:19 +0100
committerGitHub <noreply@github.com>2021-02-17 17:52:19 +0100
commit112ad83aaa7f136610baa684a1b02558cffe5887 (patch)
tree39f8fb15afba67b7e0075763148841b8dd8ef883 /jerry-core/ecma/base/ecma-globals.h
parent488a0bf7e8ebe9cf62ce270f5132f707595c0bad (diff)
Rework external function handlers (#4599)
Instead of a fixed number of arguments, a call info structure is passed to the handlers, which can be extended in the future without breaknig the API. This structure holds new.target value, so its getter function is removed. JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
Diffstat (limited to 'jerry-core/ecma/base/ecma-globals.h')
-rw-r--r--jerry-core/ecma/base/ecma-globals.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/jerry-core/ecma/base/ecma-globals.h b/jerry-core/ecma/base/ecma-globals.h
index ed4a0fab..9ef7523d 100644
--- a/jerry-core/ecma/base/ecma-globals.h
+++ b/jerry-core/ecma/base/ecma-globals.h
@@ -297,10 +297,14 @@ enum
typedef ecma_value_t (*ecma_vm_exec_stop_callback_t) (void *user_p);
/**
+ * Forward definition of jerry_call_info_t.
+ */
+struct jerry_call_info_t;
+
+/**
* Type of an external function handler.
*/
-typedef ecma_value_t (*ecma_native_handler_t) (const ecma_value_t function_obj,
- const ecma_value_t this_val,
+typedef ecma_value_t (*ecma_native_handler_t) (const struct jerry_call_info_t *call_info_p,
const ecma_value_t args_p[],
const uint32_t args_count);
@@ -881,6 +885,13 @@ typedef struct
#endif /* JERRY_BUILTIN_REALMS */
} ecma_built_in_props_t;
+/**
+ * Type of a built-in function handler.
+ */
+typedef ecma_value_t (*ecma_builtin_handler_t) (ecma_object_t *function_obj_p,
+ const ecma_value_t args_p[],
+ const uint32_t args_count);
+
#if JERRY_BUILTIN_REALMS
/**