@@ -67,7 +67,7 @@ Enum that contains JerryScript **object** value types:
6767
6868*New in version 2.4*.
6969
70- *Changed in version [[NEXT_RELEASE]]*: Added `JERRY_OBJECT_TYPE_SCRIPT`, `JERRY_OBJECT_TYPE_MODULE` values.
70+ *Changed in version [[NEXT_RELEASE]]*: Added `JERRY_OBJECT_TYPE_WEAKREF`, ` JERRY_OBJECT_TYPE_SCRIPT`, `JERRY_OBJECT_TYPE_MODULE` values.
7171
7272## jerry_function_type_t
7373
@@ -243,13 +243,16 @@ Option bits for [jerry_parse_options_t](#jerry_parse_options_t).
243243 - JERRY_PARSE_NO_OPTS - No options passed
244244 - JERRY_PARSE_STRICT_MODE - Enable strict mode
245245 - JERRY_PARSE_MODULE - Parse source as an ECMAScript module
246- - JERRY_PARSE_HAS_ARGUMENT_LIST - `argument_list` field is valid
246+ - JERRY_PARSE_HAS_ARGUMENT_LIST - `argument_list` field is valid, this also means that function parsing will be done
247247 - JERRY_PARSE_HAS_RESOURCE - `resource_name` field is valid
248248 - JERRY_PARSE_HAS_START - `start_line` and `start_column` fields are valid
249249 - JERRY_PARSE_HAS_USER_VALUE - `user_value` field is valid
250250
251251*New in version [[NEXT_RELEASE]]*.
252252
253+ Using both `JERRY_PARSE_MODULE` and `JERRY_PARSE_HAS_ARGUMENT_LIST` is an invalid combination and will result in
254+ an error during parsing.
255+
253256**See also**
254257
255258- [jerry_parse_options_t](#jerry_parse_options_t)
@@ -304,6 +307,7 @@ when the snapshot is generated and executed. Furthermore the
304307`JERRY_SNAPSHOT_EXEC_COPY_DATA` option is not allowed.
305308
306309*New in version 2.0*.
310+
307311*Changed in version [[NEXT_RELEASE]]*: The `JERRY_SNAPSHOT_SAVE_STRICT` value is removed, `JERRY_PARSE_STRICT_MODE` should be used instead.
308312
309313## jerry_exec_snapshot_opts_t
@@ -594,6 +598,11 @@ typedef struct
594598} jerry_property_descriptor_t;
595599```
596600
601+ *Changed in version [[NEXT_RELEASE]]*: The `is_value_defined`, `is_get_defined`, `is_set_defined`,
602+ `is_writable_defined`, `is_writable`, `is_enumerable_defined`,
603+ `is_enumerable`, `is_configurable_defined`, and `is_configurable`
604+ fields are replaced by the `flags` field.
605+
597606**See also**
598607
599608- [jerry_property_descriptor_flags_t](#jerry_property_descriptor_flags_t)
@@ -686,7 +695,7 @@ typedef struct jerry_call_info_t
686695} jerry_call_info_t;
687696```
688697
689- *New in version [[NEXT_RELEASE]]*.
698+ *New in version [[NEXT_RELEASE]]*. Contest of this struct replaces the `jerry_get_new_target` function.
690699
691700**See also**
692701
@@ -1717,11 +1726,13 @@ jerry_parse (const jerry_char_t *source_p,
17171726 - thrown error, otherwise
17181727
17191728*Changed in version 2.0*: Added `resource_name_p`, and `resource_name_length` arguments.
1729+
17201730*Changed in version [[NEXT_RELEASE]]*: The `resource_name_p`, `resource_name_length`, and `parse_opts` arguments are replaced by `options_p`.
1731+ This function replaces the `jerry_parse_function` method.
17211732
1722- **Example**
1733+ **Example 1 **
17231734
1724- [doctest]: # ()
1735+ [doctest]: # (name="02.API-REFERENCE-parse-simple.c" )
17251736
17261737```c
17271738#include "jerryscript.h"
@@ -1744,26 +1755,51 @@ main (void)
17441755 jerry_value_t parsed_code = jerry_parse (script, sizeof (script) - 1, &parse_options);
17451756 jerry_release_value (parse_options.resource_name);
17461757
1758+ /* Run the "parsed_code" script with "jerry_run". */
1759+
17471760 jerry_release_value (jerry_run (parsed_code));
17481761 jerry_release_value (parsed_code);
17491762
1750- /* Parsing a function. */
1763+ jerry_cleanup ();
1764+ return 0;
1765+ }
1766+ ```
1767+
1768+ **Example - function parsing**
1769+
1770+ [doctest]: # (name="02.API-REFERENCE-parse-function.c")
1771+
1772+ ```c
1773+ #include "jerryscript.h"
1774+
1775+ int
1776+ main (void)
1777+ {
1778+ jerry_init (JERRY_INIT_EMPTY);
1779+
1780+ /* Specifly the argument list to parse a function. */
1781+ jerry_parse_options_t parse_options;
17511782 parse_options.options = JERRY_PARSE_HAS_ARGUMENT_LIST;
17521783 parse_options.argument_list = jerry_create_string ((const jerry_char_t *) "a, b");
17531784
17541785 const jerry_char_t function_code[] = "return a + b;";
17551786 jerry_value_t parsed_function = jerry_parse (function_code, sizeof (function_code) - 1, &parse_options);
17561787 jerry_release_value (parse_options.argument_list);
17571788
1789+ /* Use the "parsed_function" as a normal JavaScript function. */
1790+
17581791 jerry_value_t args[] = {
17591792 jerry_create_number (3),
17601793 jerry_create_number (4),
17611794 };
17621795 jerry_size_t argc = sizeof (args) / sizeof (args[0]);
1763- jerry_release_value (jerry_call_function (parsed_function,
1764- jerry_create_undefined(),
1765- args,
1766- argc));
1796+ jerry_value_t call_result = jerry_call_function (parsed_function,
1797+ jerry_create_undefined(),
1798+ args,
1799+ argc);
1800+
1801+ /* use the function result */
1802+ jerry_release_value (call_result);
17671803 jerry_release_value (parsed_function);
17681804
17691805 jerry_cleanup ();
@@ -2284,7 +2320,7 @@ jerry_value_is_true (const jerry_value_t value);
22842320 - true, if the given `jerry_value_t` is true value
22852321 - false, otherwise
22862322
2287- *New in version [[NEXT_RELEASE]]*.
2323+ *New in version [[NEXT_RELEASE]]*. Replaces the `jerry_value_is_boolean` method.
22882324
22892325**Example**
22902326
@@ -2324,7 +2360,7 @@ jerry_value_is_false (const jerry_value_t value);
23242360 - true, if the given `jerry_value_t` is false value
23252361 - false, otherwise
23262362
2327- *New in version [[NEXT_RELEASE]]*.
2363+ *New in version [[NEXT_RELEASE]]*. Replaces the `jerry_value_is_boolean` method.
23282364
23292365**Example**
23302366
@@ -8892,7 +8928,7 @@ jerry_get_own_property_descriptor (const jerry_value_t obj_val,
88928928- `prop_desc_p` - pointer to property descriptor
88938929- return value
88948930
8895- *Changed in version [[NEXT_RELEASE]]*: return value is changed to `jerry_value_t`
8931+ *Changed in version [[NEXT_RELEASE]]*: Return value type is changed to `jerry_value_t`.
88968932
88978933**Example**
88988934
@@ -10421,7 +10457,9 @@ jerry_generate_snapshot (jerry_value_t compiled_code,
1042110457*Changed in version [[NEXT_RELEASE]]*: The `source_p`, `source_size`, `resource_name_p`,
1042210458 and `resource_name_length` arguments are replaced by `compiled_code`
1042310459 which should contain a compiled ECMAScript script / function.
10424-
10460+ The `jerry_generate_function_snapshot` is now removed and can be reproduced
10461+ by calling `jerry_parse` with function arguments and using this method
10462+ (see [jerry_exec_snapshot](#jerry_exec_snapshot)).
1042510463**Example**
1042610464
1042710465[doctest]: # ()
0 commit comments