Update document 10.EXT-REFERENCE-HANDLER.md (#5163)
The handler prototype did not match it's implementation JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
This commit is contained in:
@@ -252,7 +252,7 @@ For example usage see [jerryx_set_properties](#jerryx_set_properties).
|
||||
|
||||
# Common external function handlers
|
||||
|
||||
## jerryx_handler_assert_fatal
|
||||
## jerryx_handler_assert
|
||||
|
||||
**Summary**
|
||||
|
||||
@@ -265,12 +265,13 @@ a backtrace is also printed out.
|
||||
|
||||
```c
|
||||
jerry_value_t
|
||||
jerryx_handler_assert_fatal (const jerry_value_t func_obj_val, const jerry_value_t this_p,
|
||||
const jerry_value_t args_p[], const jerry_length_t args_cnt);
|
||||
jerryx_handler_assert (const jerry_call_info_t *call_info_p,
|
||||
const jerry_value_t args_p[],
|
||||
const jerry_length_t args_cnt);
|
||||
```
|
||||
|
||||
- `func_obj_val` - the function object that was called (unused).
|
||||
- `this_p` - the `this` value of the call (unused).
|
||||
- `call_info_p` - pointer to a [jerry_call_info_t](#jerry_call_info_t)
|
||||
structure which holds call related information (unused).
|
||||
- `args_p` - the array of function arguments.
|
||||
- `args_cnt` - the number of function arguments.
|
||||
- return value - `jerry_value_t` representing boolean true, if only one argument
|
||||
@@ -282,43 +283,6 @@ jerryx_handler_assert_fatal (const jerry_value_t func_obj_val, const jerry_value
|
||||
- [jerryx_register_global](#jerryx_register_global)
|
||||
|
||||
|
||||
## jerryx_handler_assert_throw
|
||||
|
||||
**Summary**
|
||||
|
||||
Soft assert for scripts. The routine throws an error on assertion failure.
|
||||
|
||||
**Prototype**
|
||||
|
||||
```c
|
||||
jerry_value_t
|
||||
jerryx_handler_assert_throw (const jerry_value_t func_obj_val, const jerry_value_t this_p,
|
||||
const jerry_value_t args_p[], const jerry_length_t args_cnt);
|
||||
```
|
||||
|
||||
- `func_obj_val` - the function object that was called (unused).
|
||||
- `this_p` - the `this` value of the call (unused).
|
||||
- `args_p` - the array of function arguments.
|
||||
- `args_cnt` - the number of function arguments.
|
||||
- return value - `jerry_value_t` representing boolean true, if only one argument
|
||||
was passed and that argument was a boolean true, an error otherwise.
|
||||
|
||||
**See also**
|
||||
|
||||
- [jerryx_register_global](#jerryx_register_global)
|
||||
|
||||
|
||||
## jerryx_handler_assert
|
||||
|
||||
**Summary**
|
||||
|
||||
An alias to `jerryx_handler_assert_fatal`.
|
||||
|
||||
**See also**
|
||||
|
||||
- [jerryx_handler_assert_fatal](#jerryx_handler_assert_fatal)
|
||||
|
||||
|
||||
## jerryx_handler_gc
|
||||
|
||||
**Summary**
|
||||
@@ -331,12 +295,13 @@ gc is performed, which is also the default if no parameters passed.
|
||||
|
||||
```c
|
||||
jerry_value_t
|
||||
jerryx_handler_gc (const jerry_value_t func_obj_val, const jerry_value_t this_p,
|
||||
const jerry_value_t args_p[], const jerry_length_t args_cnt);
|
||||
jerryx_handler_gc (const jerry_call_info_t *call_info_p,
|
||||
const jerry_value_t args_p[],
|
||||
const jerry_length_t args_cnt);
|
||||
```
|
||||
|
||||
- `func_obj_val` - the function object that was called (unused).
|
||||
- `this_p` - the `this` value of the call (unused).
|
||||
- `call_info_p` - pointer to a [jerry_call_info_t](#jerry_call_info_t)
|
||||
structure which holds call related information (unused).
|
||||
- `args_p` - the array of function arguments (unused).
|
||||
- `args_cnt` - the number of function arguments (unused).
|
||||
- return value - `jerry_value_t` representing `undefined`.
|
||||
@@ -365,12 +330,13 @@ ensure that their port implementation also provides
|
||||
|
||||
```c
|
||||
jerry_value_t
|
||||
jerryx_handler_print (const jerry_value_t func_obj_val, const jerry_value_t this_p,
|
||||
const jerry_value_t args_p[], const jerry_length_t args_cnt);
|
||||
jerryx_handler_print (const jerry_call_info_t *call_info_p,
|
||||
const jerry_value_t args_p[],
|
||||
const jerry_length_t args_cnt);
|
||||
```
|
||||
|
||||
- `func_obj_val` - the function object that was called (unused).
|
||||
- `this_p` - the `this` value of the call (unused).
|
||||
- `call_info_p` - pointer to a [jerry_call_info_t](#jerry_call_info_t)
|
||||
structure which holds call related information (unused).
|
||||
- `args_p` - the array of function arguments.
|
||||
- `args_cnt` - the number of function arguments.
|
||||
- return value - `jerry_value_t` representing `undefined` if all arguments could
|
||||
@@ -398,7 +364,7 @@ longer needed.
|
||||
```c
|
||||
jerry_value_t
|
||||
jerryx_register_global (const char *name_p,
|
||||
jerry_external_handler_t handler_p);
|
||||
jerry_external_handler_t handler_p);
|
||||
```
|
||||
|
||||
- `name_p` - the name of the function to be registered.
|
||||
|
||||
Reference in New Issue
Block a user