Update the webpage (#3183)
JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
This commit is contained in:
committed by
Dániel Bátyai
parent
93509a57e3
commit
09af6e670e
+51
-17
@@ -234,6 +234,7 @@ for the item by default, and if the `init_cb` field is not NULL, it will be call
|
||||
an additional custom initializer. The `deinit_cb` (if non-`NULL`) is called during a call to `jerry_cleanup ()` to run
|
||||
any custom deinitialization *before* the VM has been fully cleaned up. The `finalize_cb` (if non-`NULL`) is also called
|
||||
during a call to `jerry_cleanup ()` to run any custom deinitialization *after* the VM has been fully cleaned up.
|
||||
If bytes_needed field is 0, no buffer is allocated for the manager, callback functions are called with NULL pointer.
|
||||
|
||||
**Prototype**
|
||||
|
||||
@@ -2800,7 +2801,7 @@ main (void)
|
||||
|
||||
// Read the string into a byte buffer.
|
||||
jerry_size_t string_size = jerry_get_string_size (value);
|
||||
jerry_char_t *string_buffer_p = (jerry_char_t *) malloc (sizeof (jerry_char_t) * string_size);
|
||||
jerry_char_t *string_buffer_p = (jerry_char_t *) malloc (sizeof (jerry_char_t) * (string_size + 1));
|
||||
|
||||
jerry_size_t copied_bytes = jerry_string_to_char_buffer (value, string_buffer_p, string_size);
|
||||
string_buffer_p[copied_bytes] = '\0';
|
||||
@@ -6434,7 +6435,7 @@ jerry_create_context (uint32_t heap_size,
|
||||
|
||||
**Example**
|
||||
|
||||
[doctest]: # (test="compile")
|
||||
[doctest]: # (test="compile", name="02.API-REFERENCE-create-context.c")
|
||||
|
||||
```c
|
||||
#include <stdlib.h>
|
||||
@@ -6515,8 +6516,12 @@ main (void)
|
||||
|
||||
Generate snapshot from the specified source code.
|
||||
|
||||
*Note*: Returned value must be freed with [jerry_release_value](#jerry_release_value) when it
|
||||
is no longer needed.
|
||||
*Notes*:
|
||||
- Returned value must be freed with [jerry_release_value](#jerry_release_value) when it
|
||||
is no longer needed.
|
||||
- This API depends on a build option (`JERRY_SNAPSHOT_SAVE`) and can be checked in runtime with
|
||||
the `JERRY_FEATURE_SNAPSHOT_SAVE` feature enum value, see [jerry_is_feature_enabled](#jerry_is_feature_enabled).
|
||||
If the feature is not enabled the function will return an error.
|
||||
|
||||
**Prototype**
|
||||
|
||||
@@ -6570,7 +6575,11 @@ main (void)
|
||||
global_mode_snapshot_buffer,
|
||||
sizeof (global_mode_snapshot_buffer) / sizeof (uint32_t));
|
||||
|
||||
size_t snapshot_size = (size_t) jerry_get_number_value (generate_result);
|
||||
if (!jerry_value_is_error (generate_result))
|
||||
{
|
||||
size_t snapshot_size = (size_t) jerry_get_number_value (generate_result);
|
||||
}
|
||||
|
||||
jerry_release_value (generate_result);
|
||||
|
||||
jerry_cleanup ();
|
||||
@@ -6596,8 +6605,12 @@ with the given arguments.
|
||||
The function arguments and function body are
|
||||
passed as separated arguments.
|
||||
|
||||
*Note*: Returned value must be freed with [jerry_release_value](#jerry_release_value) when it
|
||||
is no longer needed.
|
||||
*Notes*:
|
||||
- Returned value must be freed with [jerry_release_value](#jerry_release_value) when it
|
||||
is no longer needed.
|
||||
- This API depends on a build option (`JERRY_SNAPSHOT_SAVE`) and can be checked in runtime with
|
||||
the `JERRY_FEATURE_SNAPSHOT_SAVE` feature enum value, see [jerry_is_feature_enabled](#jerry_is_feature_enabled).
|
||||
If the feature is not enabled the function will return an error.
|
||||
|
||||
**Prototype**
|
||||
|
||||
@@ -6658,7 +6671,11 @@ main (void)
|
||||
func_snapshot_buffer,
|
||||
sizeof (func_snapshot_buffer) / sizeof (uint32_t));
|
||||
|
||||
size_t snapshot_size = (size_t) jerry_get_number_value (generate_result);
|
||||
if (!jerry_value_is_error (generate_result))
|
||||
{
|
||||
size_t snapshot_size = (size_t) jerry_get_number_value (generate_result);
|
||||
}
|
||||
|
||||
jerry_release_value (generate_result);
|
||||
|
||||
jerry_cleanup ();
|
||||
@@ -6680,8 +6697,12 @@ main (void)
|
||||
|
||||
Execute snapshot from the specified buffer.
|
||||
|
||||
*Note*: Returned value must be freed with [jerry_release_value](#jerry_release_value) when it
|
||||
is no longer needed.
|
||||
*Notes*:
|
||||
- Returned value must be freed with [jerry_release_value](#jerry_release_value) when it
|
||||
is no longer needed.
|
||||
- This API depends on a build option (`JERRY_SNAPSHOT_EXEC`) and can be checked in runtime with
|
||||
the `JERRY_FEATURE_SNAPSHOT_EXEC` feature enum value, see [jerry_is_feature_enabled](#jerry_is_feature_enabled).
|
||||
If the feature is not enabled the function will return an error.
|
||||
|
||||
**Prototype**
|
||||
|
||||
@@ -6693,13 +6714,13 @@ jerry_exec_snapshot (const uint32_t *snapshot_p,
|
||||
uint32_t exec_snapshot_opts);
|
||||
```
|
||||
|
||||
- `snapshot_p` - pointer to snapshot
|
||||
- `snapshot_size` - size of snapshot in bytes
|
||||
- `func_index` - index of executed function
|
||||
- `snapshot_p` - pointer to snapshot.
|
||||
- `snapshot_size` - size of snapshot in bytes.
|
||||
- `func_index` - index of executed function.
|
||||
- `exec_snapshot_opts` - any combination of [jerry_exec_snapshot_opts_t](#jerry_exec_snapshot_opts_t) flags.
|
||||
- return value
|
||||
- result of bytecode, if run was successful
|
||||
- thrown error, otherwise
|
||||
- result of bytecode, if run was successful.
|
||||
- thrown error, otherwise (an error is reported if the snapshot execution feature is not enabled).
|
||||
|
||||
*Changed in version 2.0*: Added `func_index` and `exec_snapshot_opts` arguments. Removed the `copy_bytecode` last argument.
|
||||
|
||||
@@ -6726,6 +6747,7 @@ main (void)
|
||||
0,
|
||||
global_mode_snapshot_buffer,
|
||||
sizeof (global_mode_snapshot_buffer) / sizeof (uint32_t));
|
||||
// generate_result should be checked if it is an error or not
|
||||
|
||||
size_t global_mode_snapshot_size = (size_t) jerry_get_number_value (generate_result);
|
||||
jerry_release_value (generate_result);
|
||||
@@ -6738,6 +6760,9 @@ main (void)
|
||||
global_mode_snapshot_size,
|
||||
0,
|
||||
0);
|
||||
|
||||
// check the `res` value for error and process the result.
|
||||
|
||||
jerry_release_value (res);
|
||||
|
||||
jerry_cleanup ();
|
||||
@@ -6760,8 +6785,12 @@ Load the selected snapshot function from the specified buffer as a function obje
|
||||
|
||||
The lexical environment of the loaded function is always the global lexical environment.
|
||||
|
||||
*Note*: Returned value must be freed with [jerry_release_value](#jerry_release_value) when it
|
||||
is no longer needed.
|
||||
*Notes*:
|
||||
- Returned value must be freed with [jerry_release_value](#jerry_release_value) when it
|
||||
is no longer needed.
|
||||
- This API depends on a build option (`JERRY_SNAPSHOT_EXEC`) and can be checked in runtime with
|
||||
the `JERRY_FEATURE_SNAPSHOT_EXEC` feature enum value, see [jerry_is_feature_enabled](#jerry_is_feature_enabled).
|
||||
If the feature is not enabled the function will return an error.
|
||||
|
||||
**Prototype**
|
||||
|
||||
@@ -6856,6 +6885,11 @@ main (void)
|
||||
Collect the used literals from the given snapshot and save them into a buffer in list or C format.
|
||||
None of these literals are magic strings. In C format only valid identifiers are collected.
|
||||
|
||||
*Note*:
|
||||
- This API depends on a build option (`JERRY_SNAPSHOT_SAVE`) and can be checked in runtime with
|
||||
the `JERRY_FEATURE_SNAPSHOT_SAVE` feature enum value, see [jerry_is_feature_enabled](#jerry_is_feature_enabled).
|
||||
If the feature is not enabled the function will return zero.
|
||||
|
||||
**Prototype**
|
||||
|
||||
```c
|
||||
|
||||
Reference in New Issue
Block a user