Introduce C API to query the type of an Error object (#2177)

New api function:
* jerry_get_error_type

Additionally update a few places where this new function
can be used.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
This commit is contained in:
Péter Gál
2018-02-06 09:41:54 +01:00
committed by László Langó
parent 8041953a7a
commit 6f339eb05c
10 changed files with 217 additions and 183 deletions
+7
View File
@@ -64,6 +64,8 @@ typedef enum
*/
typedef enum
{
JERRY_ERROR_NONE = 0, /**< No Error */
JERRY_ERROR_COMMON, /**< Error */
JERRY_ERROR_EVAL, /**< EvalError */
JERRY_ERROR_RANGE, /**< RangeError */
@@ -299,6 +301,11 @@ void jerry_value_set_error_flag (jerry_value_t *value_p);
void jerry_value_set_abort_flag (jerry_value_t *value_p);
jerry_value_t jerry_get_value_without_error_flag (jerry_value_t value);
/**
* Error object function(s).
*/
jerry_error_t jerry_get_error_type (const jerry_value_t value);
/**
* Getter functions of 'jerry_value_t'.
*/