Update and fix some issues in EXT-REFERENCE documentation (#5180)
There was some issues and typos in the EXT-REFERENCE documentation. This patch fixes these issues and typos. JerryScript-DCO-1.0-Signed-off-by: Gergo Csizi gergocs@inf.u-szeged.hu
This commit is contained in:
@@ -361,6 +361,28 @@ jerryx_arg_transform_array (const jerry_value_t array_val,
|
||||
|
||||
- [jerryx_arg_array](#jerryx_arg_array)
|
||||
|
||||
## jerryx_arg_transform_optional
|
||||
|
||||
**Summary**
|
||||
|
||||
The common function to deal with optional arguments. The core transform function is provided by argument `func`.
|
||||
|
||||
**Prototype**
|
||||
|
||||
```c
|
||||
jerry_value_t jerryx_arg_transform_optional (jerryx_arg_js_iterator_t *js_arg_iter_p,
|
||||
const jerryx_arg_t *c_arg_p,
|
||||
jerryx_arg_transform_func_t func);
|
||||
```
|
||||
|
||||
- `js_arg_iter_p` - the JS arg iterator.
|
||||
- `c_arg_p` - the native arg.
|
||||
- `func` - the core transform function.
|
||||
- return value - a `jerry_value_t` representing `undefined` if all validators passed or an `Error` if a validator failed.
|
||||
|
||||
**See also**
|
||||
|
||||
- [jerryx_arg_transform_func_t](#jerryx_arg_transform_func_t)
|
||||
|
||||
# Helpers for commonly used validations
|
||||
|
||||
@@ -577,11 +599,11 @@ User should prepare the `jerryx_arg_object_props_t` instance, and pass it to thi
|
||||
|
||||
```c
|
||||
static inline jerryx_arg_t
|
||||
jerryx_arg_object_properties (const jerryx_arg_object_props_t *object_props_p,
|
||||
jerryx_arg_object_properties (const jerryx_arg_object_props_t *obj_prop_p,
|
||||
jerryx_arg_optional_t opt_flag);
|
||||
```
|
||||
- return value - the created `jerryx_arg_t` instance.
|
||||
- `object_props_p` - provides information for properties transform.
|
||||
- `obj_prop_p` - provides information for properties transform.
|
||||
- `opt_flag` - whether the argument is optional.
|
||||
|
||||
**Example**
|
||||
@@ -754,6 +776,23 @@ my_external_handler (const jerry_value_t function_obj,
|
||||
|
||||
# Functions to create custom validations
|
||||
|
||||
## jerryx_arg_ignore
|
||||
|
||||
**Summary**
|
||||
|
||||
Create a jerryx_arg_t instance for ignored argument.
|
||||
|
||||
**Prototype**
|
||||
|
||||
```c
|
||||
static inline jerryx_arg_t jerryx_arg_ignore (void);
|
||||
```
|
||||
- return value - the created `jerryx_arg_t` instance.
|
||||
|
||||
**See also**
|
||||
|
||||
- [jerryx_arg_t](#jerryx_arg_t)
|
||||
|
||||
## jerryx_arg_custom
|
||||
|
||||
**Summary**
|
||||
|
||||
@@ -24,7 +24,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**
|
||||
|
||||
@@ -63,7 +63,7 @@ to `jerryx_module_resolve` with a module name whose canonical name matches an al
|
||||
```c
|
||||
jerry_value_t
|
||||
jerryx_module_resolve (const jerry_value_t name,
|
||||
const jerryx_module_resolver_t *resolvers_p,
|
||||
const jerryx_module_resolver_t **resolvers_p,
|
||||
size_t resolver_count);
|
||||
```
|
||||
|
||||
@@ -84,7 +84,7 @@ Remove a module from the current context's cache, or clear the cache entirely.
|
||||
```c
|
||||
void
|
||||
jerryx_module_clear_cache (const jerry_value_t name,
|
||||
const jerryx_module_resolver_t *resolvers_p,
|
||||
const jerryx_module_resolver_t **resolvers_p,
|
||||
size_t resolver_count);
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user