Add a callback which is called when Error objects are created (#4465)

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2021-01-18 16:56:38 +01:00
committed by GitHub
parent e00964176d
commit 3b77117a2e
14 changed files with 249 additions and 51 deletions
+7
View File
@@ -231,6 +231,12 @@ typedef jerry_value_t (*jerry_external_handler_t) (const jerry_value_t function_
*/
typedef void (*jerry_object_native_free_callback_t) (void *native_p);
/**
* Decorator callback for Error objects. The decorator can create
* or update any properties of the newly created Error object.
*/
typedef void (*jerry_error_object_created_callback_t) (const jerry_value_t error_object, void *user_p);
/**
* Callback which tells whether the ECMAScript execution should be stopped.
*
@@ -512,6 +518,7 @@ jerry_value_t jerry_binary_operation (jerry_binary_operation_t op,
jerry_value_t jerry_create_abort_from_value (jerry_value_t value, bool release);
jerry_value_t jerry_create_error_from_value (jerry_value_t value, bool release);
jerry_value_t jerry_get_value_from_error (jerry_value_t value, bool release);
void jerry_set_error_object_created_callback (jerry_error_object_created_callback_t callback, void *user_p);
/**
* Error object function(s).