Fix typos in the documentation and related files (#4809)

JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
This commit is contained in:
Zsolt Borbély
2021-11-02 11:37:05 +01:00
committed by GitHub
parent 89e367bbfd
commit 6a995e2887
39 changed files with 173 additions and 168 deletions
+40 -35
View File
@@ -79,7 +79,7 @@ Enum that contains JerryScript **function** value types:
- JERRY_FUNCTION_TYPE_GENERIC - Generic JavaScript function
- JERRY_FUNCTION_TYPE_ACCESSOR - Accessor function
- JERRY_FUNCTION_TYPE_BOUND - Bound function
- JERRY_FUNCTION_TYPE_ARROW - Arrow fuction
- JERRY_FUNCTION_TYPE_ARROW - Arrow function
- JERRY_FUNCTION_TYPE_GENERATOR - Generator function object
*New in version 2.4*.
@@ -112,18 +112,23 @@ produce correct results.
Enum that contains JerryScript **property filter** options bits:
- JERRY_PROPERTY_FILTER_ALL - List all property keys independently from key type or property value attributes (equivalent to Reflect.ownKeys call)
- JERRY_PROPERTY_FILTER_TRAVERSE_PROTOTYPE_CHAIN - Include keys from the objects's prototype chain as well
- JERRY_PROPERTY_FILTER_EXLCUDE_NON_CONFIGURABLE - Exclude property key if the property is non-configurable
- JERRY_PROPERTY_FILTER_EXLCUDE_NON_ENUMERABLE - Exclude property key if the property is non-enumerable
- JERRY_PROPERTY_FILTER_EXLCUDE_NON_WRITABLE - Exclude property key if the property is non-writable
- JERRY_PROPERTY_FILTER_EXLCUDE_STRINGS - Exclude property key if it is a string
- JERRY_PROPERTY_FILTER_EXLCUDE_SYMBOLS - Exclude property key if it is a symbol
- JERRY_PROPERTY_FILTER_EXLCUDE_INTEGER_INDICES - Exclude property key if it is an integer index
- JERRY_PROPERTY_FILTER_ALL - List all property keys independently from key type or property value attributes (equivalent to Reflect.ownKeys call)
- JERRY_PROPERTY_FILTER_TRAVERSE_PROTOTYPE_CHAIN - Include keys from the objects' prototype chain as well
- JERRY_PROPERTY_FILTER_EXCLUDE_NON_CONFIGURABLE - Exclude property key if the property is non-configurable
- JERRY_PROPERTY_FILTER_EXCLUDE_NON_ENUMERABLE - Exclude property key if the property is non-enumerable
- JERRY_PROPERTY_FILTER_EXCLUDE_NON_WRITABLE - Exclude property key if the property is non-writable
- JERRY_PROPERTY_FILTER_EXCLUDE_STRINGS - Exclude property key if it is a string
- JERRY_PROPERTY_FILTER_EXCLUDE_SYMBOLS - Exclude property key if it is a symbol
- JERRY_PROPERTY_FILTER_EXCLUDE_INTEGER_INDICES - Exclude property key if it is an integer index
- JERRY_PROPERTY_FILTER_INTEGER_INDICES_AS_NUMBER - By default integer index property keys are converted to string. Enabling this flags keeps integer index property keys as numbers
*New in version 2.4*.
*Changed in version [[NEXT_RELEASE]]*: The following values are modified due to a typo in their names (exlcude/exclude):
`JERRY_PROPERTY_FILTER_EXLCUDE_NON_CONFIGURABLE`, `JERRY_PROPERTY_FILTER_EXLCUDE_NON_ENUMERABLE`,
`JERRY_PROPERTY_FILTER_EXLCUDE_NON_WRITABLE`, `JERRY_PROPERTY_FILTER_EXLCUDE_STRINGS`,
`JERRY_PROPERTY_FILTER_EXLCUDE_SYMBOLS`, `JERRY_PROPERTY_FILTER_EXLCUDE_INTEGER_INDICES`.
## jerry_error_t
Possible types of an error:
@@ -306,7 +311,7 @@ so their constant pools do not need to be loaded into the memory.
Hence these snapshots can be executed from ROM.
***Important note:*** The [jerry_exec_snapshot](#jerry_exec_snapshot)
function rejects static snaphots unless the `JERRY_SNAPSHOT_EXEC_ALLOW_STATIC`
function rejects static snapshots unless the `JERRY_SNAPSHOT_EXEC_ALLOW_STATIC`
option bit is set. The caller must also ensure that the same magic
strings are set by [jerry_register_magic_strings](#jerry_register_magic_strings)
when the snapshot is generated and executed. Furthermore the
@@ -618,7 +623,7 @@ typedef struct
**Summary**
Source code location data retreived by
Source code location data retrieved by
[jerry_backtrace_get_location](#jerry_backtrace_get_location).
**Prototype**
@@ -800,7 +805,7 @@ typedef void (*jerry_external_string_free_callback_t) (jerry_char_t *string_p,
void *user_p);
```
- `string_p` - extrenal string pointer
- `string_p` - external string pointer
- `string_size` - size of external string
- `user_p` - pointer passed when the external string is created
@@ -846,7 +851,7 @@ An enum representing the current status of a module
- JERRY_MODULE_STATE_INVALID - Return value for jerry_module_get_state when its argument is not a module
- JERRY_MODULE_STATE_UNLINKED - Module is currently unlinked
- JERRY_MODULE_STATE_LINKING - Module is currently being linked
- JERRY_MODULE_STATE_LINKED - Module has been linked (its depencencies has been resolved)
- JERRY_MODULE_STATE_LINKED - Module has been linked (its dependencies has been resolved)
- JERRY_MODULE_STATE_EVALUATING - Module is currently being evaluated
- JERRY_MODULE_STATE_EVALUATED - Module has been evaluated (its source code has been executed)
- JERRY_MODULE_STATE_ERROR - An error has been encountered before the evaluated state is reached
@@ -1961,7 +1966,7 @@ main (void)
{
jerry_init (JERRY_INIT_EMPTY);
/* Specifly the argument list to parse a function. */
/* Specify the argument list to parse a function. */
jerry_parse_options_t parse_options;
parse_options.options = JERRY_PARSE_HAS_ARGUMENT_LIST;
parse_options.argument_list = jerry_create_string ((const jerry_char_t *) "a, b");
@@ -5577,7 +5582,7 @@ main (void)
**Summary**
Returns the module request specified by the `request_index` argument. The requests
are ordered in source code occurence. When parsing is completed, all returned values
are ordered in source code occurrence. When parsing is completed, all returned values
are strings. If [jerry_module_link](#jerry_module_link) is completed successfully
all returned values are module objects instead. If linking is in progress or fails,
the successfully resolved dependencies are module objects, the rest are strings.
@@ -5928,7 +5933,7 @@ jerry_native_module_get_export (const jerry_value_t native_module_val,
const jerry_value_t export_name_val);
```
- `module_val` - a native module object.
- `native_module_val` - a native module object.
- `export_name_val` - string identifier of the export.
- return
- value of the export, if success
@@ -5983,12 +5988,12 @@ Sets the value of an export binding which belongs to a native module.
```c
jerry_value_t
jerry_value_t jerry_native_module_set_export (const jerry_value_t native_mmodule_val,
jerry_value_t jerry_native_module_set_export (const jerry_value_t native_module_val,
const jerry_value_t export_name_val,
const jerry_value_t value_to_set)
```
- `module_val` - a native module object.
- `native_module_val` - a native module object.
- `export_name_val` - string identifier of the export.
- `value_to_set` - new value of the export.
- return
@@ -6081,7 +6086,7 @@ example (void)
// acquire/create a promise object.
jerry_value_t promise = jerry_create_promise ();
{
// prepare the argumnent for the resolve or reject.
// prepare the argument for the resolve or reject.
jerry_value_t argument = jerry_create_number (33);
jerry_value_t is_ok = jerry_resolve_or_reject_promise (promise,
@@ -6153,7 +6158,7 @@ example (void)
// a Promise have a default state of JERRY_PROMISE_STATE_PENDING
{
// prepare the argumnent for the resolve or reject.
// prepare the argument for the resolve or reject.
jerry_value_t argument = jerry_create_number (33);
jerry_value_t is_ok = jerry_resolve_or_reject_promise (promise,
@@ -6384,7 +6389,7 @@ jerry_resolve_or_reject_promise (jerry_value_t promise,
- `argument` - the argument for resolve or reject
- `is_resolve` - whether the promise should be resolved or rejected
- return value
- undefined jerry value - resolve or reject successed
- undefined jerry value - success of resolve or reject
- jerry value with error flag - otherwise
*New in version 2.0*.
@@ -6400,7 +6405,7 @@ jerry_resolve_or_reject_promise (jerry_value_t promise,
...
bool is_resolve = ... // whether the promise should be resolved or rejected
jerry_value_t argument = ... // prepare the argumnent for the resolve or reject.
jerry_value_t argument = ... // prepare the argument for the resolve or reject.
jerry_value_t is_ok = jerry_resolve_or_reject_promise (promise,
argument,
@@ -6621,7 +6626,7 @@ These APIs all depend on build option (`JERRY_BUILTIN_BIGINT`).
Returns the size of uint64 digits of a BigInt value. This value is the
minimum size of the buffer which can hold all digits of a BigInt value when
the digits are retreived by `[jerry_get_bigint_digits](#jerry_get_bigint_digits)`.
the digits are retrieved by `[jerry_get_bigint_digits](#jerry_get_bigint_digits)`.
*Notes*:
- This API depends on a build option (`JERRY_BUILTIN_BIGINT`) and can be checked
@@ -7043,7 +7048,7 @@ jerry_create_arraybuffer_external (const jerry_length_t size
- `buffer_p` - the backing store used by the array buffer object.
- `arraybuffer_user_p` - user pointer assigned to the array buffer object.
- return value
- value of the newly construced array buffer object.
- value of the newly constructed array buffer object.
*New in version 2.0*.
@@ -7146,7 +7151,7 @@ jerry_create_shared_arraybuffer_external (const jerry_length_t size
- `buffer_p` - the backing store used by the shared array buffer object.
- `arraybuffer_user_p` - user pointer assigned to the shared array buffer object.
- return value
- value of the newly construced shared array buffer object.
- value of the newly constructed shared array buffer object.
*New in version [[NEXT_RELEASE]]*.
@@ -9479,7 +9484,7 @@ method_setter (const jerry_call_info_t *call_info_p,
const jerry_length_t argc)
{
// Note: the arguments count and type should be checked
// in this example it is ommitted!
// in this example it is omitted!
double new_value = jerry_get_number_value (args[0]);
counter = (int) new_value;
@@ -10062,12 +10067,12 @@ main (void)
shape_p->perimeter = 12;
jerry_set_object_native_pointer (object, shape_p, &shape_obj_type_info);
// The native pointer can be NULL. This gives possibily to get notified via the native type info's
// The native pointer can be NULL. This gives possibly to get notified via the native type info's
// free callback when the object has been freed by the GC.
jerry_set_object_native_pointer (object, NULL, &destructor_obj_type_info);
// The native type info can be NULL as well. In this case the registered property is simply freed
// when the object is freed by te GC.
// when the object is freed by the GC.
jerry_set_object_native_pointer (object, SECRET_INFO, NULL);
do_stuff (object);
@@ -11083,7 +11088,7 @@ jerry_generate_snapshot (jerry_value_t compiled_code,
- `buffer_p` - output buffer (aligned to 4 bytes) to save snapshot to.
- `buffer_size` - the output buffer's size in bytes.
- return value
- the size of the generated snapshot in bytes as number value, if it was generated succesfully (i.e. there
- the size of the generated snapshot in bytes as number value, if it was generated successfully (i.e. there
are no syntax errors in source code, buffer size is sufficient, and snapshot support is enabled in
current configuration through JERRY_SNAPSHOT_SAVE)
- thrown error, otherwise.
@@ -11170,7 +11175,7 @@ jerry_exec_snapshot (const uint32_t *snapshot_p,
- `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.
- `options_values_p` - additional loadig options, can be NULL if not used. The fields are described in
- `options_values_p` - additional loading options, can be NULL if not used. The fields are described in
[jerry_exec_snapshot_option_values_t](#jerry_exec_snapshot_option_values_t).
- return value
- result of bytecode, if run was successful.
@@ -11333,7 +11338,7 @@ jerry_get_literals_from_snapshot (const uint32_t *snapshot_p,
- `lit_buf_size` - the buffer's size.
- `is_c_format` - the output format would be C-style (true) or a simple list (false).
- return value
- the size of the literal-list, if it was generated succesfully (i.e. the list of literals isn't empty,
- the size of the literal-list, if it was generated successfully (i.e. the list of literals isn't empty,
and literal-save support is enabled in current configuration through JERRY_SNAPSHOT_SAVE)
- 0 otherwise.
@@ -11903,7 +11908,7 @@ backtrace_callback (jerry_backtrace_frame_t *frame_p,
if (jerry_backtrace_is_strict (frame_p))
{
printf ("Strict mode code is running");
return truel
return true;
}
printf ("Non-strict mode code is running");
@@ -12554,7 +12559,7 @@ jerry_arraybuffer_read (const jerry_value_t value,
{
uint8_t data[20];
jerry_value_t buffer;
// ... create the ArrayBuffer or acuiqre it from somewhere.
// ... create the ArrayBuffer or acquire it from somewhere.
jerry_value_t bytes_read;
@@ -13106,7 +13111,7 @@ jerry_get_typedarray_type (jerry_value_t value);
```c
{
jerry_typedarray_type_t expected_type = JERRY_TYPEDARRAY_UINT32;
jerry_value_t typedarray = jerry_create_typedarray (expected_klass, 25);
jerry_value_t typedarray = jerry_create_typedarray (expected_class, 25);
jerry_typedarray_type_t type = jerry_get_typedarray_type (typedarray);
@@ -13262,7 +13267,7 @@ main (void)
const jerry_char_t data[] = "{\"name\": \"John\", \"age\": 5}";
jerry_value_t obj = jerry_json_parse (data, sizeof (data) - 1);
/* "obj" now conatins and object created from the "data" JSON string. */
/* "obj" now contains and object created from the "data" JSON string. */
jerry_release_value (obj);