Add support for aborts. (#2176)
Aborts are similar to exceptions except they are not caught by catch and finally blocks. Callbacks should honor aborts as well and return them without processing them. Aborts are never thrown by JavaScript code. In the future certain events such as out-of-memory condition may also throw aborts. JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
@@ -1457,13 +1457,54 @@ jerry_value_has_error_flag (const jerry_value_t value);
|
||||
**See also**
|
||||
|
||||
- [jerry_value_t](#jerry_value_t)
|
||||
- [jerry_value_has_abort_flag](#jerry_value_has_abort_flag)
|
||||
|
||||
|
||||
## jerry_value_has_abort_flag
|
||||
|
||||
**Summary**
|
||||
|
||||
Returns whether the given `jerry_value_t` has the error and abort flags set.
|
||||
|
||||
**Prototype**
|
||||
|
||||
```c
|
||||
bool
|
||||
jerry_value_has_abort_flag (const jerry_value_t value);
|
||||
```
|
||||
|
||||
- `value` - api value
|
||||
- return value
|
||||
- true, if the given `jerry_value_t` has the error and abort flags set
|
||||
- false, otherwise
|
||||
|
||||
**Example**
|
||||
|
||||
```c
|
||||
{
|
||||
jerry_value_t value;
|
||||
... // create or acquire value
|
||||
|
||||
if (jerry_value_has_abort_flag (value))
|
||||
{
|
||||
...
|
||||
}
|
||||
|
||||
jerry_release_value (value);
|
||||
}
|
||||
```
|
||||
|
||||
**See also**
|
||||
|
||||
- [jerry_value_t](#jerry_value_t)
|
||||
- [jerry_value_has_error_flag](#jerry_value_has_error_flag)
|
||||
|
||||
|
||||
## jerry_value_clear_error_flag
|
||||
|
||||
**Summary**
|
||||
|
||||
Clear the error flag.
|
||||
Clear both the error and abort flags.
|
||||
|
||||
**Prototype**
|
||||
|
||||
@@ -1490,6 +1531,8 @@ jerry_value_clear_error_flag (jerry_value_t *value_p);
|
||||
**See also**
|
||||
|
||||
- [jerry_value_t](#jerry_value_t)
|
||||
- [jerry_value_set_error_flag](#jerry_value_set_error_flag)
|
||||
- [jerry_value_set_abort_flag](#jerry_value_set_abort_flag)
|
||||
|
||||
|
||||
## jerry_value_set_error_flag
|
||||
@@ -1523,6 +1566,43 @@ jerry_value_set_error_flag (jerry_value_t *value_p);
|
||||
**See also**
|
||||
|
||||
- [jerry_value_t](#jerry_value_t)
|
||||
- [jerry_value_clear_error_flag](#jerry_value_clear_error_flag)
|
||||
- [jerry_value_set_abort_flag](#jerry_value_set_abort_flag)
|
||||
|
||||
|
||||
## jerry_value_set_abort_flag
|
||||
|
||||
**Summary**
|
||||
|
||||
Set both the error and abort flags.
|
||||
|
||||
**Prototype**
|
||||
|
||||
```c
|
||||
void
|
||||
jerry_value_set_abort_flag (jerry_value_t *value_p);
|
||||
```
|
||||
|
||||
- `value_p` - pointer to an api value
|
||||
|
||||
**Example**
|
||||
|
||||
```c
|
||||
{
|
||||
jerry_value_t value;
|
||||
... // create or acquire value
|
||||
|
||||
jerry_value_set_abort_flag (&value);
|
||||
|
||||
jerry_release_value (value);
|
||||
}
|
||||
```
|
||||
|
||||
**See also**
|
||||
|
||||
- [jerry_value_t](#jerry_value_t)
|
||||
- [jerry_value_clear_error_flag](#jerry_value_clear_error_flag)
|
||||
- [jerry_value_set_error_flag](#jerry_value_set_error_flag)
|
||||
|
||||
|
||||
## jerry_get_value_without_error_flag
|
||||
|
||||
Reference in New Issue
Block a user