Update the webpage (jerryscript.net) (#5203)

JerryScript-DCO-1.0-Signed-off-by: Laszlo Lango laszlo.lango@h-lab.eu
This commit is contained in:
László Langó
2024-12-18 13:45:27 +01:00
committed by GitHub
parent 9192b862c9
commit 493994dd0d
10 changed files with 1201 additions and 384 deletions
+22 -57
View File
@@ -34,7 +34,7 @@ The engine must be initialized before specifying the `jerry_value_t` in the stru
typedef struct {
const char *name;
jerry_value_t value;
} jerryx_function_list_entry;
} jerryx_property_entry;
```
**See also**
@@ -262,7 +262,7 @@ For example usage see [jerryx_set_properties](#jerryx_set_properties).
# Common external function handlers
## jerryx_handler_assert_fatal
## jerryx_handler_assert
**Summary**
@@ -275,12 +275,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
@@ -292,43 +293,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**
@@ -341,12 +305,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`.
@@ -361,26 +326,26 @@ jerryx_handler_gc (const jerry_value_t func_obj_val, const jerry_value_t this_p,
**Summary**
Provide a `print` implementation for scripts. The routine converts all of its
arguments to strings and outputs them char-by-char using
`jerry_port_print_byte`. The NULL character is output as "\u0000",
other characters are output bytewise.
arguments to strings and outputs them by using `jerry_port_print_buffer`.
The NULL character is output as "\u0000", other characters are output bytewise.
*Note*: This implementation does not use standard C `printf` to print its
output. This allows more flexibility but also extends the core JerryScript
engine port API. Applications that want to use `jerryx_handler_print` must
ensure that their port implementation also provides
`jerry_port_print_byte`.
`jerry_port_print_buffer`.
**Prototype**
```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
@@ -389,7 +354,7 @@ jerryx_handler_print (const jerry_value_t func_obj_val, const jerry_value_t this
**See also**
- [jerryx_register_global](#jerryx_register_global)
- [jerry_port_print_byte](05.PORT-API.md#jerry_port_print_char)
- [jerry_port_print_buffer](05.PORT-API.md#jerry_port_print_buffer)
# Handler registration helper
@@ -408,7 +373,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.