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
+1 -1
View File
@@ -1,7 +1,7 @@
# Configuration
JerryScript provides a large number of configuration options which can be used to enable or disable specific features, allowing users to fine tune the engine to best suit their needs.
A configuration option's value can be changed either by providing specific C preprocessor definitions, by adding CMake defininitions, or by using the arguments of the `tools/build.py` script.
A configuration option's value can be changed either by providing specific C preprocessor definitions, by adding CMake definitions, or by using the arguments of the `tools/build.py` script.
This document lists the available configuration options, shows the configuration name for C, CMake, and python, and provides a brief description that explains the effect of the options.
+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);
+2 -2
View File
@@ -78,7 +78,7 @@ Argument combinations are limited to the following seven forms:
## Literals
Literals are organized into groups whose represent various literal types. Having these groups consuming less space than assigning flag bits to each literal.
(In the followings, the mentioned ranges represent those indicies which are greater than or equal to the left side and less than the right side of the range. For example a range between `ident_end` and `literal_end` fields of the byte-code header contains those indicies, which are greater than or equal to `ident_end`
(In the followings, the mentioned ranges represent those indices which are greater than or equal to the left side and less than the right side of the range. For example a range between `ident_end` and `literal_end` fields of the byte-code header contains those indices, which are greater than or equal to `ident_end`
and less than `literal_end`. If `ident_end` equals to `literal_end` the range is empty.)
The two major group of literals are _identifiers_ and _values_.
@@ -271,7 +271,7 @@ An object can be a conventional data object or a lexical environment object. Unl
[Lexical environments](http://www.ecma-international.org/ecma-262/5.1/#sec-10.2) are implemented as objects in JerryScript, since lexical environments contains key-value pairs (called bindings) like objects. This simplifies the implementation and reduces code size.
![Object/Lexicat environment structures](img/ecma_object.png)
![Object/Lexical environment structures](img/ecma_object.png)
The objects are represented as following structure:
+3 -3
View File
@@ -72,8 +72,8 @@ typedef enum
void jerry_port_log (jerry_log_level_t level, const char *fmt, ...);
```
The `jerry_port_print_char` is currenlty not used by the jerry-core directly.
However, it provides a port specifc way for `jerry-ext` components to print
The `jerry_port_print_char` is currently not used by the jerry-core directly.
However, it provides a port specific way for `jerry-ext` components to print
information.
```c
@@ -284,7 +284,7 @@ void
jerry_port_print_char (char c)
{
putchar (c);
} /* jerr_port_print_char */
} /* jerry_port_print_char */
```
## Date
+3 -3
View File
@@ -46,7 +46,7 @@ is doing.
/* not a complete sentence */
/* A bad mulitiline
/* A bad multiline
comment. */
```
@@ -369,7 +369,7 @@ a = 6;
b = 7;
/* No newlines are allowed between control staments
/* No newlines are allowed between control statements
* and their code blocks. */
if (a > 6)
@@ -419,7 +419,7 @@ a=b+c;
a = b+c;
a += c + ( d );
/* Introduce temporary variables or macros
* if the expression is too long. Occures rarely.. */
* if the expression is too long. Occurs rarely.. */
a = b
+ c;
if ( a + b > 0 )
+6 -6
View File
@@ -141,7 +141,7 @@ jerryx_has_property_str (const jerry_value_t target_object,
- `target_object` - object on which the property name is accessed
- `name` - property name as an UTF-8 `char*`
- return value
- true, if the given property name exsits on the object
- true, if the given property name exists on the object
- false, if there is no such property name or there was an error accessing the property
**Example**
@@ -180,7 +180,7 @@ for this the following utility structures and methods are provided.
Structure to define an array of properties with `name` and `value` fields which
can be registered to a target object.
The engine must be initialied before specifying the `jerry_value_t` in the struct.
The engine must be initialized before specifying the `jerry_value_t` in the struct.
**Prototype**
@@ -209,7 +209,7 @@ successfully registered methods.
This must be passed for the [jerryx_release_property_entry](#jerryx_release_property_entry) method
after the property registration.
If any error occured during the property registration the `result` field of the structure
If any error occurred during the property registration the `result` field of the structure
must be manually released after processing the error value.
**Prototype**
@@ -393,7 +393,7 @@ Release all `jerry_value_t` in a `jerryx_property_entry` array based on a previo
and also the error value (if any) in the `jerryx_register_result` structure.
In case of a successful registration it is safe to call this method.
After the method call the `ęntries` array should not be used as all values are released.
After the method call the `entries` array should not be used as all values are released.
**Prototype**
@@ -403,7 +403,7 @@ jerryx_release_property_entry (const jerryx_property_entry entries[],
const jerryx_register_result register_result);
```
- `entires` - array of [jerryx_property_entry](#jerryx_property_entry).
- `entries` - array of [jerryx_property_entry](#jerryx_property_entry).
- `register_result` - result of a previous [jerryx_set_properties](#jerryx_set_properties) call.
**Example**
@@ -513,7 +513,7 @@ jerryx_handler_gc (const jerry_value_t func_obj_val, const jerry_value_t this_p,
Provide a `print` implementation for scripts. The routine converts all of its
arguments to strings and outputs them char-by-char using
`jerry_port_print_char`. The NUL character is output as "\u0000",
`jerry_port_print_char`. The NULL character is output as "\u0000",
other characters are output bytewise.
*Note*: This implementation does not use standard C `printf` to print its
+1 -1
View File
@@ -257,7 +257,7 @@ symbols so that they may be called explicitly from within the application.
#define JERRYX_NATIVE_MODULE(module_name, on_resolve_cb)
```
- `module_name` - the name of the module without quotes. This value is used as the prefix for the registration and unregistration funtions. For example, when `module_name` is `example_module`, this results in the declaration of two functions `example_module_register()` and `example_module_unregister()`. These functions are declared global if support for library constructors/destructors is absent, allowing you to call them from other parts of the code by
- `module_name` - the name of the module without quotes. This value is used as the prefix for the registration and unregistration functions. For example, when `module_name` is `example_module`, this results in the declaration of two functions `example_module_register()` and `example_module_unregister()`. These functions are declared global if support for library constructors/destructors is absent, allowing you to call them from other parts of the code by
first forward-declaring them.
- `on_resolve_cb` - the function of type `jerryx_native_module_on_resolve_t` that will be called when the module needs to be
loaded.
+2 -2
View File
@@ -100,7 +100,7 @@ typedef bool (*jerry_debugger_transport_receive_t) (struct jerry_debugger_transp
**Summary**
Add a new interface to the transporation interface chain. The interface
Add a new interface to the transportation interface chain. The interface
will be the first item of the interface chain.
**Prototype**
@@ -111,7 +111,7 @@ void jerry_debugger_transport_add (jerry_debugger_transport_header_t *header_p,
size_t receive_message_header_size, size_t max_receive_message_size);
```
- `header_p`: header of a transporation interface.
- `header_p`: header of a transportation interface.
- `send_message_header_size`: size of the outgoing message header, can be 0.
- `max_send_message_size`: maximum outgoing message size supported by the interface.
- `receive_message_header_size`: size of the incoming message header, can be 0.
+3 -3
View File
@@ -7,7 +7,7 @@ Embedders wishing to use native builtin modules with ES6 imports can use the [Po
## General
If a script contains import statements, then JerryScript will open and evaluate the the referenced modules before the main script runs, resolving and creating bindings for the referenced identifiers in the process.
It is not necessary to use any specific filename extensions for modules, JerryScript will try to open the given file paths as they are, but will try to normalize them before doing so. The exact normalization process is dependant on the port implementation provided. It is the user's responsibility to verify that the given files are valid EcmaScript modules.
It is not necessary to use any specific filename extensions for modules, JerryScript will try to open the given file paths as they are, but will try to normalize them before doing so. The exact normalization process is dependant on the port implementation provided. It is the user's responsibility to verify that the given files are valid ECMAScript modules.
main.js
@@ -76,7 +76,7 @@ export var version = "1.0 (e92ae0fb)";
```js
// module_2.js
var featureName = "EcmaScript modules";
var featureName = "ECMAScript modules";
var year = 2018;
export function getFeatureDetails() {
@@ -86,7 +86,7 @@ export function getFeatureDetails() {
### Module namespace import statements
A module namespace object can be imported. In this case the local binding will contain an object holding the exported values of the module, including local exports and all indirect exports. Ambiguous exported names are exluded from the namespace object.
A module namespace object can be imported. In this case the local binding will contain an object holding the exported values of the module, including local exports and all indirect exports. Ambiguous exported names are excluded from the namespace object.
```js
import * as module from './module.js';
+3 -3
View File
@@ -1,11 +1,11 @@
# Migration guide
This guide intends to describe the major changes between the JerryScript 1.0 and 2.0 versions.
In addtion it is designed to provide a guide on how to modify the 1.0 version code to a
In addition it is designed to provide a guide on how to modify the 1.0 version code to a
2.0 compliant code.
During the development it was important to minimize the changes in the API functions and types.
Each API method removal or chang is described below providing a ***before*** and ***after***
Each API method removal or change is described below providing a ***before*** and ***after***
code example.
For more information on the current API methods please check the [API reference](02.API-REFERENCE.md) document.
@@ -53,7 +53,7 @@ For more information on the current API methods please check the [API reference]
## Error manipulating functions
The most important changes in the API are releated to error handling and manipulation.
The most important changes in the API are related to error handling and manipulation.
### jerry_value_set_abort_flag