aboutsummaryrefslogtreecommitdiff
path: root/jerry-ext/handler/handler-assert.c
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-ext/handler/handler-assert.c
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-ext/handler/handler-assert.c')
-rw-r--r--jerry-ext/handler/handler-assert.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/jerry-ext/handler/handler-assert.c b/jerry-ext/handler/handler-assert.c
index 6b1b7f37..fc88b685 100644
--- a/jerry-ext/handler/handler-assert.c
+++ b/jerry-ext/handler/handler-assert.c
@@ -29,13 +29,11 @@
* Note that the function does not return otherwise.
*/
jerry_value_t
-jerryx_handler_assert_fatal (const jerry_value_t func_obj_val, /**< function object */
- const jerry_value_t this_p, /**< this arg */
+jerryx_handler_assert_fatal (const jerry_call_info_t *call_info_p, /**< call information */
const jerry_value_t args_p[], /**< function arguments */
const jerry_length_t args_cnt) /**< number of function arguments */
{
- (void) func_obj_val; /* unused */
- (void) this_p; /* unused */
+ (void) call_info_p; /* unused */
if (args_cnt == 1
&& jerry_value_is_boolean (args_p[0])
@@ -100,13 +98,11 @@ jerryx_handler_assert_fatal (const jerry_value_t func_obj_val, /**< function obj
* error - otherwise.
*/
jerry_value_t
-jerryx_handler_assert_throw (const jerry_value_t func_obj_val, /**< function object */
- const jerry_value_t this_p, /**< this arg */
+jerryx_handler_assert_throw (const jerry_call_info_t *call_info_p, /**< call information */
const jerry_value_t args_p[], /**< function arguments */
const jerry_length_t args_cnt) /**< number of function arguments */
{
- (void) func_obj_val; /* unused */
- (void) this_p; /* unused */
+ (void) call_info_p; /* unused */
if (args_cnt == 1
&& jerry_value_is_boolean (args_p[0])
@@ -125,10 +121,9 @@ jerryx_handler_assert_throw (const jerry_value_t func_obj_val, /**< function obj
* Note that the function does not return otherwise.
*/
jerry_value_t
-jerryx_handler_assert (const jerry_value_t func_obj_val, /**< function object */
- const jerry_value_t this_p, /**< this arg */
+jerryx_handler_assert (const jerry_call_info_t *call_info_p, /**< call information */
const jerry_value_t args_p[], /**< function arguments */
const jerry_length_t args_cnt) /**< number of function arguments */
{
- return jerryx_handler_assert_fatal (func_obj_val, this_p, args_p, args_cnt);
+ return jerryx_handler_assert_fatal (call_info_p, args_p, args_cnt);
} /* jerryx_handler_assert */