Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 17 additions & 51 deletions docs/10.EXT-REFERENCE-HANDLER.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**

Expand All @@ -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
Expand All @@ -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**
Expand All @@ -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`.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion jerry-ext/util/handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jerryx_handler_assert (const jerry_call_info_t *call_info_p, /**< call informati
jerryx_print_backtrace (5);

jerry_port_fatal (JERRY_FATAL_FAILED_ASSERTION);
} /* jerryx_handler_assert_fatal */
} /* jerryx_handler_assert */

/**
* Expose garbage collector to scripts.
Expand Down
2 changes: 1 addition & 1 deletion jerry-ext/util/print.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ jerryx_print_backtrace (unsigned depth)
}

jerry_value_free (backtrace_array);
} /* jerryx_handler_assert_fatal */
} /* jerryx_print_backtrace */

/**
* Print an unhandled exception value
Expand Down
4 changes: 2 additions & 2 deletions jerry-port/common/jerry-port-fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ jerry_port_path_normalize (const jerry_char_t *path_p, /**< input path */
memcpy (buffer_p, path_p, path_size + 1);

return buffer_p;
} /* jerry_port_normalize_path */
} /* jerry_port_path_normalize */

/**
* Free a path buffer returned by jerry_port_path_normalize.
Expand All @@ -139,7 +139,7 @@ void JERRY_ATTR_WEAK
jerry_port_path_free (jerry_char_t *path_p)
{
free (path_p);
} /* jerry_port_normalize_path */
} /* jerry_port_path_free */

/**
* Computes the end of the directory part of a path.
Expand Down
Loading