Lines Matching refs:jerry_value_t
218 ## jerry_value_t section in JerryScript types
233 typedef uint32_t jerry_value_t;
263 …e* the VM has been cleaned up. This is a good place to release strong references to jerry_value_t's
395 jerry_value_t value;
398 jerry_value_t getter;
401 jerry_value_t setter;
444 typedef jerry_value_t (*jerry_external_handler_t) (const jerry_value_t function_obj,
445 const jerry_value_t this_val,
446 const jerry_value_t args_p[],
527 typedef bool (*jerry_object_property_foreach_t) (const jerry_value_t property_name,
528 const jerry_value_t property_value,
554 typedef bool (*jerry_objects_foreach_t) (const jerry_value_t object,
581 typedef bool (*jerry_objects_foreach_by_native_info_t) (const jerry_value_t object,
613 typedef jerry_value_t (*jerry_vm_exec_stop_callback_t) (void *user_p);
945 jerry_value_t object_value = jerry_create_object ();
1025 jerry_value_t
1058 …jerry_value_t parsed_code = jerry_parse (NULL, 0, script, sizeof (script) - 1, JERRY_PARSE_NO_OPTS…
1088 jerry_value_t
1132 jerry_value_t parsed_function = jerry_parse_function (NULL,
1143 jerry_value_t args[] = {
1148 jerry_value_t ret_value = jerry_call_function (parsed_function,
1199 jerry_value_t
1200 jerry_run (const jerry_value_t func_val);
1224 …jerry_value_t parsed_code = jerry_parse (NULL, 0, script, sizeof (script) - 1, JERRY_PARSE_NO_OPTS…
1229 jerry_value_t ret_value = jerry_run (parsed_code);
1260 jerry_value_t
1275 jerry_value_t ret_val = jerry_eval (str_to_eval,
1298 jerry_value_t
1320 …jerry_value_t parsed_code = jerry_parse (NULL, 0, script, sizeof (script) - 1, JERRY_PARSE_NO_OPTS…
1321 jerry_value_t script_value = jerry_run (parsed_code);
1322 jerry_value_t job_value = jerry_run_all_enqueued_jobs ();
1348 jerry_value_t
1358 jerry_value_t glob_obj_val = jerry_get_global_object ();
1374 Functions to check the type of an API value ([jerry_value_t](#jerry_value_t)).
1380 Returns whether the given `jerry_value_t` has the error and abort value set.
1386 jerry_value_is_abort (const jerry_value_t value);
1391 - true, if the given `jerry_value_t` has the error and abort value set
1400 jerry_value_t value;
1414 - [jerry_value_t](#jerry_value_t)
1421 Returns whether the given `jerry_value_t` is an array.
1427 jerry_value_is_array (const jerry_value_t value)
1432 - true, if the given `jerry_value_t` is an array
1439 jerry_value_t value;
1459 Returns whether the given `jerry_value_t` is an ArrayBuffer object.
1471 jerry_value_is_arraybuffer (const jerry_value_t value)
1476 - true, if the given `jerry_value_t` is an ArrayBuffer object.
1485 jerry_value_t value;
1507 Returns whether the given `jerry_value_t` is a boolean value.
1513 jerry_value_is_boolean (const jerry_value_t value)
1518 - true, if the given `jerry_value_t` is a boolean value
1525 jerry_value_t value;
1546 Returns whether the given `jerry_value_t` is a constructor function.
1552 jerry_value_is_constructor (const jerry_value_t value)
1557 - true, if the given `jerry_value_t` is a constructor
1564 jerry_value_t value;
1584 Returns whether the given `jerry_value_t` is a DataView object value.
1596 jerry_value_is_dataview (const jerry_value_t value)
1601 - true, if the given `jerry_value_t` is a DataView object
1618 jerry_value_t arraybuffer = jerry_create_arraybuffer (16);
1619 jerry_value_t dataview = jerry_create_dataview (arraybuffer, 0, 16);
1644 Returns whether the given `jerry_value_t` is error value.
1650 jerry_value_is_error (const jerry_value_t value);
1655 - true, if the given `jerry_value_t` is error value.
1664 jerry_value_t value;
1678 - [jerry_value_t](#jerry_value_t)
1685 Returns whether the given `jerry_value_t` is a function.
1691 jerry_value_is_function (const jerry_value_t value)
1696 - true, if the given `jerry_value_t` is a function
1703 jerry_value_t value;
1724 Returns whether the given `jerry_value_t` is a number.
1730 jerry_value_is_number (const jerry_value_t value)
1735 - true, if the given `jerry_value_t` is a number
1742 jerry_value_t value;
1763 Returns whether the given `jerry_value_t` is a null value.
1769 jerry_value_is_null (const jerry_value_t value)
1774 - true, if the given `jerry_value_t` is a null
1781 jerry_value_t value;
1802 Returns whether the given `jerry_value_t` is an object value.
1808 jerry_value_is_object (const jerry_value_t value)
1813 - true, if the given `jerry_value_t` is an object
1820 jerry_value_t value;
1841 Returns whether the given `jerry_value_t` is a promise value.
1854 jerry_value_is_promise (const jerry_value_t value)
1859 - true, if the given `jerry_value_t` is a promise
1868 jerry_value_t value;
1890 Returns whether the given `jerry_value_t` is a proxy value.
1903 jerry_value_is_proxy (const jerry_value_t value)
1908 - true, if the given `jerry_value_t` is a proxy object
1917 jerry_value_t value;
1939 Returns whether the given `jerry_value_t` is a string value.
1945 jerry_value_is_string (const jerry_value_t value)
1950 - true, if the given `jerry_value_t` is a string
1957 jerry_value_t value;
1978 Returns whether the given `jerry_value_t` is a symbol value.
1990 jerry_value_is_symbol (const jerry_value_t value)
1995 - true, if the given `jerry_value_t` is a symbol
2012 …jerry_value_t string_value = jerry_create_string ((const jerry_char_t *) "Symbol description strin…
2013 jerry_value_t symbol_value = jerry_create_symbol (string_value);
2038 Checks whether the given `jerry_value_t` is a TypedArray object or not.
2050 jerry_value_is_typedarray (const jerry_value_t value)
2055 - true, if the given `jerry_value_t` is a TypedArray object.
2072 jerry_value_t value = jerry_create_typedarray (JERRY_TYPEDARRAY_UINT16, 15);
2096 Checks whether the given `jerry_value_t` is the given `jerry_container_type_t` type container objec…
2111 jerry_get_container_type (const jerry_value_t value)
2129 jerry_value_t value = jerry_create_container (JERRY_CONTAINER_TYPE_MAP, NULL, 0);
2154 Returns whether the given `jerry_value_t` is an undefined value.
2160 jerry_value_is_undefined (const jerry_value_t value)
2165 - true, if the given `jerry_value_t` is an undefined value
2172 jerry_value_t value;
2203 jerry_value_get_type (const jerry_value_t value);
2216 jerry_value_t number = jerry_create_number (3.3);
2287 jerry_value_t
2289 const jerry_value_t lhs,
2290 const jerry_value_t rhs);
2306 jerry_value_t value1;
2307 jerry_value_t value2;
2309 jerry_value_t result = jerry_binary_operation (JERRY_BIN_OP_EQUAL, value1, value2)
2340 static jerry_value_t
2341 my_constructor (const jerry_value_t func_val,
2342 const jerry_value_t this_val,
2343 const jerry_value_t argv[],
2354 jerry_value_t base_obj = jerry_create_object ();
2355 jerry_value_t constructor = jerry_create_external_function (my_constructor);
2358 jerry_value_t prototype_str = jerry_create_string ((const jerry_char_t *) ("prototype"));
2363 jerry_value_t instance_val = jerry_construct_object (constructor, NULL, 0);
2366 jerry_value_t is_instance = jerry_binary_operation (JERRY_BIN_OP_INSTANCEOF,
2411 jerry_value_t
2412 jerry_create_abort_from_value (jerry_value_t value, bool release);
2425 jerry_value_t value;
2428 jerry_value_t abort = jerry_create_abort_from_value (value, true);
2439 jerry_value_t value;
2442 jerry_value_t abort = jerry_create_abort_from_value (value, false);
2452 - [jerry_value_t](#jerry_value_t)
2472 jerry_value_t
2473 jerry_create_error_from_value (jerry_value_t value, bool release);
2486 jerry_value_t value;
2489 jerry_value_t error = jerry_create_error_from_value (value, true);
2501 jerry_value_t value;
2504 jerry_value_t error = jerry_create_error_from_value (value, false);
2514 - [jerry_value_t](#jerry_value_t)
2534 jerry_get_error_type (const jerry_value_t value);
2548 jerry_value_t error_obj = jerry_create_error (JERRY_ERROR_RANGE,
2583 jerry_value_t
2584 jerry_get_value_from_error (jerry_value_t value, bool release)
2597 jerry_value_t value;
2600 jerry_value_t error = jerry_create_error_from_value (value, true);
2601 jerry_value_t value_from_error = jerry_get_value_from_error (error, true);
2612 jerry_value_t value;
2615 jerry_value_t error = jerry_create_error_from_value (value, true);
2616 jerry_value_t value_from_error = jerry_get_value_from_error (error, false);
2626 - [jerry_value_t](#jerry_value_t)
2630 # Getter functions of 'jerry_value_t'
2638 Gets the raw bool value from a `jerry_value_t`.
2644 jerry_get_boolean_value (const jerry_value_t value);
2654 jerry_value_t value;
2680 Gets the number value of the given `jerry_value_t` parameter as a raw double.
2688 jerry_get_number_value (const jerry_value_t value);
2693 - the number value of the given `jerry_value_t` parameter as a raw double.
2700 jerry_value_t value;
2734 jerry_get_string_size (const jerry_value_t value);
2744 jerry_value_t string = jerry_create_string (char_array);
2775 jerry_get_utf8_string_size (const jerry_value_t value);
2787 jerry_value_t string = jerry_create_string (char_array);
2819 jerry_get_string_length (const jerry_value_t value);
2830 jerry_value_t string = jerry_create_string (char_array);
2862 jerry_get_utf8_string_length (const jerry_value_t value);
2875 jerry_value_t string = jerry_create_string_from_utf8 (char_array);
2914 jerry_string_to_char_buffer (const jerry_value_t value,
2938 jerry_value_t value;
2989 jerry_string_to_utf8_char_buffer (const jerry_value_t value,
3005 jerry_value_t value;
3042 jerry_substring_to_char_buffer (const jerry_value_t value,
3062 jerry_value_t value;
3101 jerry_substring_to_utf8_char_buffer (const jerry_value_t value,
3121 jerry_value_t value;
3155 jerry_get_array_length (const jerry_value_t value);
3165 jerry_value_t value;
3179 # Converters of 'jerry_value_t'
3193 jerry_value_to_boolean (const jerry_value_t value);
3205 jerry_value_t value;
3231 jerry_value_t
3232 jerry_value_to_number (const jerry_value_t value);
3244 jerry_value_t value;
3247 jerry_value_t number_value = jerry_value_to_number (value);
3271 jerry_value_t
3272 jerry_value_to_object (const jerry_value_t value);
3284 jerry_value_t value;
3287 jerry_value_t object_value = jerry_value_to_object (value);
3310 jerry_value_t
3311 jerry_value_to_primitive (const jerry_value_t value);
3323 jerry_value_t value;
3326 jerry_value_t prim_value = jerry_value_to_primitive (value);
3335 - [jerry_value_t](#jerry_value_t)
3349 jerry_value_t
3350 jerry_value_to_string (const jerry_value_t value);
3362 jerry_value_t value;
3365 jerry_value_t string_value = jerry_value_to_string (value);
3399 jerry_value_t
3400 jerry_get_promise_result (const jerry_value_t promise);
3423 jerry_value_t promise = jerry_create_promise ();
3426 jerry_value_t argument = jerry_create_number (33);
3428 jerry_value_t is_ok = jerry_resolve_or_reject_promise (promise,
3437 jerry_value_t promise_result = jerry_get_promise_result (promise);
3467 jerry_get_promise_state (const jerry_value_t promise);
3489 jerry_value_t promise = jerry_create_promise ();
3496 jerry_value_t argument = jerry_create_number (33);
3498 jerry_value_t is_ok = jerry_resolve_or_reject_promise (promise,
3537 jerry_value_t
3538 jerry_resolve_or_reject_promise (jerry_value_t promise,
3539 jerry_value_t argument,
3556 jerry_value_t promise = ... // acquire/create a promise object.
3561 jerry_value_t argument = ... // prepare the argumnent for the resolve or reject.
3563 jerry_value_t is_ok = jerry_resolve_or_reject_promise (promise,
3606 jerry_value_t
3607 jerry_get_symbol_descriptive_string (const jerry_value_t value);
3629 jerry_value_t string_value = jerry_create_string ((const jerry_char_t *) "foo");
3630 jerry_value_t symbol_value = jerry_create_symbol (string_value);
3634 jerry_value_t symbol_desc_string = jerry_get_symbol_descriptive_string (symbol_value);
3661 jerry_value_t
3662 jerry_acquire_value (jerry_value_t value);
3672 jerry_value_t object_value = jerry_create_object ();
3674 jerry_value_t acquired_object = jerry_acquire_value (object_value);
3688 - [jerry_value_t](#jerry_value_t)
3701 jerry_release_value (jerry_value_t value);
3710 jerry_value_t object_value = jerry_create_object ();
3721 Function for creating [API values](#jerry_value_t).
3738 jerry_value_t
3749 jerry_value_t array = jerry_create_array (10);
3767 Create a jerry_value_t representing an ArrayBuffer object.
3777 jerry_value_t
3782 - return value - the new ArrayBuffer as a `jerry_value_t`
3790 jerry_value_t buffer_value = jerry_create_arraybuffer (15);
3810 Creates a jerry_value_t representing an ArrayBuffer object with
3825 jerry_value_t
3835 - the new ArrayBuffer as a `jerry_value_t`
3845 jerry_value_t buffer_value = jerry_create_arraybuffer_external (15, buffer_p, NULL);
3867 Create a jerry_value_t representing a boolean value from the given boolean parameter.
3872 jerry_value_t
3877 - return value - a `jerry_value_t` created from the given boolean argument.
3883 jerry_value_t boolean_value = jerry_create_boolean (true);
3911 jerry_value_t
3924 jerry_value_t error_obj = jerry_create_error (JERRY_ERROR_TYPE,
3953 jerry_value_t
3969 jerry_value_t error_obj = jerry_create_error_sz (JERRY_ERROR_COMMON,
3998 jerry_value_t
3999 jerry_create_dataview (const jerry_value_t array_buffer,
4025 jerry_value_t arraybuffer = jerry_create_arraybuffer (16);
4026 jerry_value_t dataview = jerry_create_dataview (arraybuffer, 0, 16);
4056 jerry_value_t
4072 static jerry_value_t
4073 handler (const jerry_value_t function_obj,
4074 const jerry_value_t this_val,
4075 const jerry_value_t args_p[],
4088 jerry_value_t func_val = jerry_create_external_function (handler);
4089 jerry_value_t glob_obj = jerry_get_global_object ();
4092 jerry_value_t prop_name = jerry_create_string ((const jerry_char_t *) "handler_field");
4102 jerry_value_t ret_val = jerry_eval ((const jerry_char_t *) test_src,
4123 Creates a `jerry_value_t` representing a number value.
4131 jerry_value_t
4135 - `value` - double value from which a `jerry_value_t` will be created
4136 - return value - a `jerry_value_t` created from the given double argument
4142 jerry_value_t number_value = jerry_create_number (3.14);
4161 Creates a `jerry_value_t` representing a positive or negative infinity value.
4169 jerry_value_t
4174 - return value - a `jerry_value_t` representing the infinity value
4180 jerry_value_t positive_inf_value = jerry_create_number_infinity (false);
4199 Creates a `jerry_value_t` representing a not-a-number value.
4207 jerry_value_t
4211 - return value - a `jerry_value_t` representing the not-a-number value
4217 jerry_value_t nan_value = jerry_create_number_nan ();
4236 Creates and returns a `jerry_value_t` with type null object.
4241 jerry_value_t
4245 - return value - a `jerry_value_t` representing null.
4251 jerry_value_t null_value = jerry_create_null ();
4276 jerry_value_t
4286 jerry_value_t object_value = jerry_create_object ();
4314 jerry_value_t
4326 jerry_value_t p = jerry_create_promise ();
4354 jerry_value_t
4355 jerry_create_proxy (const jerry_value_t target,
4356 const jerry_value_t handler)
4378 jerry_value_t target = jerry_create_object ();
4379 jerry_value_t handler = jerry_create_object ();
4380 jerry_value_t proxy = jerry_create_proxy (target, handler);
4411 jerry_value_t
4423 jerry_value_t string_value = jerry_create_string (char_array);
4449 jerry_value_t
4463 jerry_value_t string_value = jerry_create_string_sz (char_array,
4493 jerry_value_t
4507 jerry_value_t string_value = jerry_create_string_from_utf8 (char_array);
4535 jerry_value_t
4551 jerry_value_t string_value = jerry_create_string_sz_from_utf8 (char_array,
4582 jerry_value_t
4583 jerry_create_symbol (const jerry_value_t value)
4605 …jerry_value_t string_value = jerry_create_string ((const jerry_char_t *) "Symbol description strin…
4606 jerry_value_t symbol_value = jerry_create_symbol (string_value);
4629 Returns a `jerry_value_t` RegExp object or an error, if the construction of the object fails.
4638 jerry_value_t
4644 - return value - the RegExp object as a `jerry_value_t`
4655 jerry_value_t regexp = jerry_create_regexp (pattern_p, pattern_flags);
4668 Returns a `jerry_value_t` RegExp object or an error, if the construction of the object fails.
4677 jerry_value_t
4684 - return value - the RegExp object as a `jerry_value_t`
4696 jerry_value_t regexp = jerry_create_regexp_sz (pattern_p, pattern_size, pattern_flags);
4709 Create a jerry_value_t representing an TypedArray object.
4725 jerry_value_t
4731 - return value - the new TypedArray as a `jerry_value_t`
4739 jerry_value_t array = jerry_create_typedarray (JERRY_TYPEDARRAY_UINT16, 15);
4758 Create a jerry_value_t representing an TypedArray object using
4781 jerry_value_t
4783 const jerry_value_t arraybuffer);
4789 - the new TypedArray as a `jerry_value_t`
4798 jerry_value_t buffer = jerry_create_array_buffer (12 * 2);
4799 jerry_value_t array = jerry_create_typedarray_for_arraybuffer (JERRY_TYPEDARRAY_UINT16, buffer);
4819 Create a jerry_value_t representing an TypedArray object using
4842 jerry_value_t
4844 const jerry_value_t arraybuffer,
4854 - the new TypedArray as a `jerry_value_t`
4863 jerry_value_t buffer = jerry_create_array_buffer (12 * 2);
4864 …jerry_value_t array = jerry_create_typedarray_for_arraybuffer_sz (JERRY_TYPEDARRAY_UINT16, buffer,…
4884 Create a jerry_value_t representing a given type container object.
4901 jerry_value_t
4903 const jerry_value_t *arguments_list_p,
4910 - return value - the new container object as a `jerry_value_t`
4924 jerry_value_t iterable = jerry_eval (src, sizeof (src) - 1, JERRY_PARSE_NO_OPTS);
4926 jerry_value_t map = jerry_create_container (JERRY_CONTAINER_TYPE_MAP, &iterable, 1);
4948 Creates a `jerry_value_t` representing an undefined value.
4953 jerry_value_t
4963 jerry_value_t undefined_value = jerry_create_undefined ();
4990 jerry_value_t
4991 jerry_has_property (const jerry_value_t obj_val,
4992 const jerry_value_t prop_name_val);
5016 jerry_value_t global_object = jerry_get_global_object ();
5017 jerry_value_t prop_name = jerry_create_string ((const jerry_char_t *) "handler_field");
5019 jerry_value_t has_prop_js = jerry_has_property (global_object, prop_name);
5050 jerry_value_t
5051 jerry_has_own_property (const jerry_value_t obj_val,
5052 const jerry_value_t prop_name_val);
5076 jerry_value_t global_object = jerry_get_global_object ();
5077 jerry_value_t prop_name = jerry_create_string ((const jerry_char_t *) "handler_field");
5079 jerry_value_t has_prop_js = jerry_has_own_property (global_object, prop_name);
5114 jerry_has_internal_property (const jerry_value_t obj_val,
5115 const jerry_value_t prop_name_val);
5138 jerry_value_t global_object = jerry_get_global_object ();
5139 jerry_value_t prop_name = jerry_create_string ((const jerry_char_t *) "hidden_property");
5167 jerry_delete_property (const jerry_value_t obj_val,
5168 const jerry_value_t prop_name_val);
5181 jerry_value_t global_object = jerry_get_global_object ();
5182 jerry_value_t prop_name = jerry_create_string ((const jerry_char_t *) "my_prop");
5210 jerry_delete_property_by_index (const jerry_value_t obj_val,
5226 jerry_value_t object;
5259 jerry_delete_internal_property (const jerry_value_t obj_val,
5260 const jerry_value_t prop_name_val);
5275 jerry_value_t global_object = jerry_get_global_object ();
5276 jerry_value_t prop_name = jerry_create_string ((const jerry_char_t *) "hidden_property");
5305 jerry_value_t
5306 jerry_get_property (const jerry_value_t obj_val,
5307 const jerry_value_t prop_name_val);
5328 jerry_value_t global_object = jerry_get_global_object ();
5329 jerry_value_t prop_name = jerry_create_string ((const jerry_char_t *) "Object");
5331 jerry_value_t prop_value = jerry_get_property (global_object, prop_name);
5366 jerry_value_t
5367 jerry_get_property_by_index (const jerry_value_t obj_val,
5381 jerry_value_t object;
5385 jerry_value_t value = jerry_get_property_by_index (object, 5);
5419 jerry_value_t
5420 jerry_get_internal_property (const jerry_value_t obj_val,
5421 const jerry_value_t prop_name_val);
5445 jerry_value_t global_object = jerry_get_global_object ();
5446 jerry_value_t prop_name = jerry_create_string ((const jerry_char_t *) "hidden_property");
5448 jerry_value_t prop_value = jerry_get_internal_property (global_object, prop_name);
5479 jerry_value_t
5480 jerry_set_property (const jerry_value_t obj_val,
5481 const jerry_value_t prop_name_val,
5482 const jerry_value_t value_to_set)
5496 jerry_value_t value_to_set;
5500 jerry_value_t glob_obj = jerry_get_global_object ();
5501 jerry_value_t prop_name = jerry_create_string ((const jerry_char_t *) "my_prop");
5503 jerry_value_t set_result = jerry_set_property (glob_obj, prop_name, value_to_set);
5540 jerry_value_t
5541 jerry_set_property_by_index (const jerry_value_t obj_val,
5543 const jerry_value_t value_to_set);
5557 jerry_value_t object;
5558 jerry_value_t value_to_set;
5562 jerry_value_t ret_val = jerry_set_property_by_index (object, 5, value_to_set);
5598 jerry_set_internal_property (const jerry_value_t obj_val,
5599 const jerry_value_t prop_name_val,
5600 const jerry_value_t value_to_set)
5624 jerry_value_t global_object = jerry_get_global_object ();
5625 jerry_value_t prop_name = jerry_create_string ((const jerry_char_t *) "hidden_property");
5626 jerry_value_t value_to_set = jerry_create_number (5);
5698 jerry_value_t
5699 jerry_define_own_property (const jerry_value_t obj_val,
5700 const jerry_value_t prop_name_val,
5725 jerry_value_t global_obj_val = jerry_get_global_object ();
5731 jerry_value_t value_to_set;
5746 jerry_value_t prop_name = jerry_create_string ((const jerry_char_t *) "my_prop");
5747 jerry_value_t return_value = jerry_define_own_property (global_obj_val, prop_name, &prop_desc);
5778 static jerry_value_t
5779 method_getter (const jerry_value_t this_obj,
5780 const jerry_value_t func_obj,
5781 const jerry_value_t args[],
5790 static jerry_value_t
5791 method_setter (const jerry_value_t this_obj,
5792 const jerry_value_t func_obj,
5793 const jerry_value_t args[],
5812 jerry_value_t global_obj_val = jerry_get_global_object ();
5826 jerry_value_t prop_name = jerry_create_string ((const jerry_char_t *) "my_prop");
5827 jerry_value_t return_value = jerry_define_own_property (global_obj_val, prop_name, &prop_desc);
5844 …jerry_value_t eval_result = jerry_eval ((const jerry_char_t *) src_p, strlen (src_p), JERRY_PARSE_…
5874 jerry_get_own_property_descriptor (const jerry_value_t obj_val,
5875 const jerry_value_t prop_name_val,
5888 jerry_value_t global_obj_val = jerry_get_global_object ();
5893 jerry_value_t prop_name = jerry_create_string ((const jerry_char_t *) "my_prop");
5961 jerry_value_t
5962 jerry_call_function (const jerry_value_t func_obj_val,
5963 const jerry_value_t this_val,
5964 const jerry_value_t args_p[],
5978 jerry_value_t target_function;
5984 jerry_value_t this_val = jerry_create_undefined ();
5985 jerry_value_t ret_val = jerry_call_function (target_function, this_val, NULL, 0);
6019 jerry_value_t
6020 jerry_construct_object (const jerry_value_t func_obj_val,
6021 const jerry_value_t args_p[],
6034 jerry_value_t val;
6040 jerry_value_t ret_val = jerry_construct_object (val, NULL, 0);
6069 jerry_value_t
6070 jerry_get_object_keys (const jerry_value_t obj_val);
6082 jerry_value_t object;
6085 jerry_value_t keys_array = jerry_get_object_keys (object);
6111 jerry_value_t
6112 jerry_get_prototype (const jerry_value_t obj_val);
6124 jerry_value_t object;
6127 jerry_value_t prototype = jerry_get_prototype (object);
6153 jerry_value_t
6154 jerry_set_prototype (const jerry_value_t obj_val,
6155 const jerry_value_t proto_obj_val);
6168 jerry_value_t object;
6169 jerry_value_t prototype;
6173 jerry_value_t ret_val = jerry_set_prototype (object, prototype);
6201 jerry_get_object_native_pointer (const jerry_value_t obj_val,
6297 do_stuff (jerry_value_t object)
6358 jerry_value_t object = jerry_create_object ();
6416 jerry_set_object_native_pointer (const jerry_value_t obj_val,
6457 jerry_delete_object_native_pointer (const jerry_value_t obj_val,
6492 jerry_foreach_object_property (jerry_value_t obj_val,
6524 foreach_function (const jerry_value_t prop_name,
6525 const jerry_value_t prop_value,
6553 jerry_value_t object = jerry_create_object ();
6555 jerry_value_t test_property = jerry_create_string ((const jerry_char_t *) "DemoProp");
6556 jerry_value_t test_value = jerry_create_number (3);
6558 jerry_value_t set_result = jerry_set_property (object, test_property, test_value);
6621 jerry_value_t property_name;
6622 jerry_value_t result;
6629 find_my_object (const jerry_value_t candidate,
6635 jerry_value_t has_property = jerry_has_property (candidate, info_p->property_name);
6660 jerry_value_t test_object = jerry_create_object ();
6663 jerry_value_t test_property = jerry_create_string ((const jerry_char_t *) "DemoProp");
6664 jerry_value_t test_value = jerry_create_number (3);
6665 jerry_value_t set_result = jerry_set_property (test_object, test_property, test_value);
6674 jerry_value_t global_object = jerry_get_global_object ();
6675 jerry_value_t demo_property = jerry_create_string ((const jerry_char_t *) "DemoObject");
6676 jerry_value_t set_result = jerry_set_property (global_object, demo_property, test_object);
6766 jerry_value_t found_object;
6794 jerry_value_t test_object = jerry_create_object ();
6802 jerry_value_t global_object = jerry_get_global_object ();
6803 jerry_value_t demo_property = jerry_create_string ((const jerry_char_t *) "DemoObject");
6804 jerry_value_t set_result = jerry_set_property (global_object, demo_property, test_object);
6818 find_object (const jerry_value_t candidate, void *data_p, void *user_data_p)
6979 jerry_value_t string_value = jerry_create_string_sz (script,
7171 jerry_value_t
7211 jerry_value_t generate_result;
7260 jerry_value_t
7305 jerry_value_t generate_result;
7352 jerry_value_t
7384 jerry_value_t generate_result;
7401 jerry_value_t res = jerry_exec_snapshot (global_mode_snapshot_buffer,
7440 jerry_value_t
7473 jerry_value_t generate_result;
7491 jerry_value_t func = jerry_load_function_snapshot (snapshot_buffer,
7497 jerry_value_t this_value = jerry_create_undefined ();
7498 jerry_value_t args[2];
7502 jerry_value_t res = jerry_call_function (func, this_value, args, 2);
7504 /* 'res' now contains the value 3 as a jerry_value_t */
7575 jerry_value_t generate_result = jerry_generate_snapshot (NULL,
7657 static jerry_value_t
7680 …jerry_value_t parsed_code = jerry_parse (NULL, 0, script, sizeof (script) - 1, JERRY_PARSE_NO_OPTS…
7715 jerry_value_t
7734 static jerry_value_t
7735 backtrace_handler (const jerry_value_t function_obj,
7736 const jerry_value_t this_val,
7737 const jerry_value_t args_p[],
7746 jerry_value_t backtrace_array = jerry_get_backtrace (5);
7751 jerry_value_t property = jerry_get_property_by_index (backtrace_array, idx);
7775 jerry_value_t global = jerry_get_global_object ();
7779 jerry_value_t func = jerry_create_external_function (backtrace_handler);
7780 jerry_value_t name = jerry_create_string ((const jerry_char_t *) "backtrace");
7781 jerry_value_t result = jerry_set_property (global, name, func);
7795 jerry_value_t program = jerry_parse ((const jerry_char_t *) resource,
7802 jerry_value_t run_result = jerry_run (program);
7836 jerry_value_t
7837 jerry_get_resource_name (jerry_value_t value);
7856 static jerry_value_t
7857 resource_name_handler (const jerry_value_t function_obj,
7858 const jerry_value_t this_val,
7859 const jerry_value_t args_p[],
7862 jerry_value_t undefined_value = jerry_create_undefined ();
7863 …jerry_value_t resource_name = jerry_get_resource_name (args_count > 0 ? args_p[0] : undefined_valu…
7874 jerry_value_t global = jerry_get_global_object ();
7878 jerry_value_t func = jerry_create_external_function (resource_name_handler);
7879 jerry_value_t name = jerry_create_string ((const jerry_char_t *) "resourceName");
7880 jerry_value_t result = jerry_set_property (global, name, func);
7891 jerry_value_t program = jerry_parse (resource,
7900 jerry_value_t run_result = jerry_run (program);
7937 jerry_value_t
7955 static jerry_value_t
7956 demo_handler (const jerry_value_t func_obj_val,
7957 const jerry_value_t this_val,
7958 const jerry_value_t args_p[],
7961 jerry_value_t new_target = jerry_get_new_target ();
7979 jerry_value_t function_val = jerry_create_external_function (demo_handler);
7981 jerry_value_t ret_val = jerry_construct_object (function_val, NULL, 0);
8000 static jerry_value_t
8001 demo_handler (const jerry_value_t func_obj_val,
8002 const jerry_value_t this_val,
8003 const jerry_value_t args_p[],
8006 jerry_value_t new_target = jerry_get_new_target ();
8025 jerry_value_t global_obj_val = jerry_get_global_object ();
8026 jerry_value_t function_val = jerry_create_external_function (demo_handler);
8027 jerry_value_t function_name_val = jerry_create_string ((const jerry_char_t *) "demo");
8028 jerry_value_t result_val = jerry_set_property (global_obj_val, function_name_val, function_val);
8036 jerry_value_t ret_val = jerry_eval ((const jerry_char_t *) src,
8066 jerry_get_arraybuffer_byte_length (const jerry_value_t value);
8080 jerry_value_t buffer = jerry_create_arraybuffer (15);
8111 jerry_arraybuffer_read (const jerry_value_t value,
8133 jerry_value_t buffer;
8136 jerry_value_t bytes_read;
8175 jerry_arraybuffer_write (const jerry_value_t value,
8204 jerry_value_t buffer;
8207 jerry_value_t bytes_written;
8244 jerry_get_arraybuffer_pointer (const jerry_value_t value);
8259 jerry_value_t buffer = jerry_create_arraybuffer (16);
8288 jerry_value_t
8289 jerry_is_arraybuffer_detachable (const jerry_value_t value);
8304 jerry_value_t buffer = jerry_create_arraybuffer (16);
8306 jerry_value_t res = jerry_is_arraybuffer_detachable (buffer);
8331 jerry_value_t
8332 jerry_detach_arraybuffer (const jerry_value_t value);
8349 jerry_value_t buffer = jerry_create_arraybuffer (length, buf, NULL);
8351 jerry_value_t res = jerry_detach_arraybuffer (buffer);
8377 jerry_value_t
8378 jerry_get_dataview_buffer (const jerry_value_t value,
8404 jerry_value_t arraybuffer = jerry_create_arraybuffer (16);
8405 jerry_value_t dataview = jerry_create_dataview (arraybuffer, 0, 16);
8408 jerry_value_t buffer = jerry_get_dataview_buffer (dataview, &byteOffset, &byteLength);
8442 jerry_get_typedarray_type (jerry_value_t value);
8457 jerry_value_t typedarray = jerry_create_typedarray (expected_klass, 25);
8485 jerry_get_typedarray_length (jerry_value_t value);
8499 jerry_value_t array = jerry_create_typedarray (JERRY_TYPEDARRAY_INT32, 21);
8531 jerry_value_t
8532 jerry_get_typedarray_buffer (jerry_value_t value,
8550 jerry_value_t array = jerry_create_typedarray (JERRY_TYPEDARRAY_INT16, 11);
8554 jerry_value_t buffer = jerry_get_typedarray_buffer (array, &byteOffset, &byteLength);
8580 jerry_value_t
8588 - jerry_value_t containing the same as json.parse()
8589 - jerry_value_t containing error massage
8598 jerry_value_t parsed_json = jerry_json_parse (data, sizeof (data) - 1);
8615 jerry_value_t
8616 jerry_json_stringify (const jerry_value_t object_to_stringify);
8619 - `object_to_stringify` - a jerry_value_t object to stringify
8621 - jerry_value_t containing the same as json.stringify()
8622 - jerry_value_t containing error massage
8630 jerry_value_t obj = jerry_create_object ();
8631 jerry_value_t key = jerry_create_string ((const jerry_char_t *) "name");
8632 jerry_value_t value = jerry_create_string ((const jerry_char_t *) "John");
8634 jerry_value_t stringified = jerry_json_stringify (obj);