示例#1
0
static bool
handler_throw_test (const jerry_api_object_t *function_obj_p,
                    const jerry_api_value_t *this_p,
                    jerry_api_value_t *ret_val_p,
                    const jerry_api_value_t args_p[],
                    const jerry_api_length_t args_cnt)
{
  printf ("ok %p %p %p %d %p\n", function_obj_p, this_p, args_p, args_cnt, ret_val_p);

  jerry_api_object_t* error_p = jerry_api_create_error (JERRY_API_ERROR_TYPE,
                                                        (jerry_api_char_t *) "error");

  test_api_init_api_value_object (ret_val_p, error_p);

  jerry_api_release_object (error_p);

  return false;
}
示例#2
0
JObject CreateError(const char* message, jerry_api_error_t error) {
  return JObject(jerry_api_create_error(
      error, reinterpret_cast<const jerry_api_char_t*>(message)));
}