Skip to content

Commit 6a995e2

Browse files
author
Zsolt Borbély
authored
Fix typos in the documentation and related files (#4809)
JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély [email protected]
1 parent 89e367b commit 6a995e2

39 files changed

+173
-168
lines changed

docs/01.CONFIGURATION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Configuration
22

33
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.
4-
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.
4+
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.
55
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.
66

77

docs/02.API-REFERENCE.md

Lines changed: 40 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Enum that contains JerryScript **function** value types:
7979
- JERRY_FUNCTION_TYPE_GENERIC - Generic JavaScript function
8080
- JERRY_FUNCTION_TYPE_ACCESSOR - Accessor function
8181
- JERRY_FUNCTION_TYPE_BOUND - Bound function
82-
- JERRY_FUNCTION_TYPE_ARROW - Arrow fuction
82+
- JERRY_FUNCTION_TYPE_ARROW - Arrow function
8383
- JERRY_FUNCTION_TYPE_GENERATOR - Generator function object
8484

8585
*New in version 2.4*.
@@ -112,18 +112,23 @@ produce correct results.
112112

113113
Enum that contains JerryScript **property filter** options bits:
114114

115-
- JERRY_PROPERTY_FILTER_ALL - List all property keys independently from key type or property value attributes (equivalent to Reflect.ownKeys call)
116-
- JERRY_PROPERTY_FILTER_TRAVERSE_PROTOTYPE_CHAIN - Include keys from the objects's prototype chain as well
117-
- JERRY_PROPERTY_FILTER_EXLCUDE_NON_CONFIGURABLE - Exclude property key if the property is non-configurable
118-
- JERRY_PROPERTY_FILTER_EXLCUDE_NON_ENUMERABLE - Exclude property key if the property is non-enumerable
119-
- JERRY_PROPERTY_FILTER_EXLCUDE_NON_WRITABLE - Exclude property key if the property is non-writable
120-
- JERRY_PROPERTY_FILTER_EXLCUDE_STRINGS - Exclude property key if it is a string
121-
- JERRY_PROPERTY_FILTER_EXLCUDE_SYMBOLS - Exclude property key if it is a symbol
122-
- JERRY_PROPERTY_FILTER_EXLCUDE_INTEGER_INDICES - Exclude property key if it is an integer index
115+
- JERRY_PROPERTY_FILTER_ALL - List all property keys independently from key type or property value attributes (equivalent to Reflect.ownKeys call)
116+
- JERRY_PROPERTY_FILTER_TRAVERSE_PROTOTYPE_CHAIN - Include keys from the objects' prototype chain as well
117+
- JERRY_PROPERTY_FILTER_EXCLUDE_NON_CONFIGURABLE - Exclude property key if the property is non-configurable
118+
- JERRY_PROPERTY_FILTER_EXCLUDE_NON_ENUMERABLE - Exclude property key if the property is non-enumerable
119+
- JERRY_PROPERTY_FILTER_EXCLUDE_NON_WRITABLE - Exclude property key if the property is non-writable
120+
- JERRY_PROPERTY_FILTER_EXCLUDE_STRINGS - Exclude property key if it is a string
121+
- JERRY_PROPERTY_FILTER_EXCLUDE_SYMBOLS - Exclude property key if it is a symbol
122+
- JERRY_PROPERTY_FILTER_EXCLUDE_INTEGER_INDICES - Exclude property key if it is an integer index
123123
- 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
124124

125125
*New in version 2.4*.
126126

127+
*Changed in version [[NEXT_RELEASE]]*: The following values are modified due to a typo in their names (exlcude/exclude):
128+
`JERRY_PROPERTY_FILTER_EXLCUDE_NON_CONFIGURABLE`, `JERRY_PROPERTY_FILTER_EXLCUDE_NON_ENUMERABLE`,
129+
`JERRY_PROPERTY_FILTER_EXLCUDE_NON_WRITABLE`, `JERRY_PROPERTY_FILTER_EXLCUDE_STRINGS`,
130+
`JERRY_PROPERTY_FILTER_EXLCUDE_SYMBOLS`, `JERRY_PROPERTY_FILTER_EXLCUDE_INTEGER_INDICES`.
131+
127132
## jerry_error_t
128133

129134
Possible types of an error:
@@ -306,7 +311,7 @@ so their constant pools do not need to be loaded into the memory.
306311
Hence these snapshots can be executed from ROM.
307312

308313
***Important note:*** The [jerry_exec_snapshot](#jerry_exec_snapshot)
309-
function rejects static snaphots unless the `JERRY_SNAPSHOT_EXEC_ALLOW_STATIC`
314+
function rejects static snapshots unless the `JERRY_SNAPSHOT_EXEC_ALLOW_STATIC`
310315
option bit is set. The caller must also ensure that the same magic
311316
strings are set by [jerry_register_magic_strings](#jerry_register_magic_strings)
312317
when the snapshot is generated and executed. Furthermore the
@@ -618,7 +623,7 @@ typedef struct
618623

619624
**Summary**
620625

621-
Source code location data retreived by
626+
Source code location data retrieved by
622627
[jerry_backtrace_get_location](#jerry_backtrace_get_location).
623628

624629
**Prototype**
@@ -800,7 +805,7 @@ typedef void (*jerry_external_string_free_callback_t) (jerry_char_t *string_p,
800805
void *user_p);
801806
```
802807

803-
- `string_p` - extrenal string pointer
808+
- `string_p` - external string pointer
804809
- `string_size` - size of external string
805810
- `user_p` - pointer passed when the external string is created
806811

@@ -846,7 +851,7 @@ An enum representing the current status of a module
846851
- JERRY_MODULE_STATE_INVALID - Return value for jerry_module_get_state when its argument is not a module
847852
- JERRY_MODULE_STATE_UNLINKED - Module is currently unlinked
848853
- JERRY_MODULE_STATE_LINKING - Module is currently being linked
849-
- JERRY_MODULE_STATE_LINKED - Module has been linked (its depencencies has been resolved)
854+
- JERRY_MODULE_STATE_LINKED - Module has been linked (its dependencies has been resolved)
850855
- JERRY_MODULE_STATE_EVALUATING - Module is currently being evaluated
851856
- JERRY_MODULE_STATE_EVALUATED - Module has been evaluated (its source code has been executed)
852857
- JERRY_MODULE_STATE_ERROR - An error has been encountered before the evaluated state is reached
@@ -1961,7 +1966,7 @@ main (void)
19611966
{
19621967
jerry_init (JERRY_INIT_EMPTY);
19631968

1964-
/* Specifly the argument list to parse a function. */
1969+
/* Specify the argument list to parse a function. */
19651970
jerry_parse_options_t parse_options;
19661971
parse_options.options = JERRY_PARSE_HAS_ARGUMENT_LIST;
19671972
parse_options.argument_list = jerry_create_string ((const jerry_char_t *) "a, b");
@@ -5577,7 +5582,7 @@ main (void)
55775582
**Summary**
55785583

55795584
Returns the module request specified by the `request_index` argument. The requests
5580-
are ordered in source code occurence. When parsing is completed, all returned values
5585+
are ordered in source code occurrence. When parsing is completed, all returned values
55815586
are strings. If [jerry_module_link](#jerry_module_link) is completed successfully
55825587
all returned values are module objects instead. If linking is in progress or fails,
55835588
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,
59285933
const jerry_value_t export_name_val);
59295934
```
59305935

5931-
- `module_val` - a native module object.
5936+
- `native_module_val` - a native module object.
59325937
- `export_name_val` - string identifier of the export.
59335938
- return
59345939
- value of the export, if success
@@ -5983,12 +5988,12 @@ Sets the value of an export binding which belongs to a native module.
59835988

59845989
```c
59855990
jerry_value_t
5986-
jerry_value_t jerry_native_module_set_export (const jerry_value_t native_mmodule_val,
5991+
jerry_value_t jerry_native_module_set_export (const jerry_value_t native_module_val,
59875992
const jerry_value_t export_name_val,
59885993
const jerry_value_t value_to_set)
59895994
```
59905995

5991-
- `module_val` - a native module object.
5996+
- `native_module_val` - a native module object.
59925997
- `export_name_val` - string identifier of the export.
59935998
- `value_to_set` - new value of the export.
59945999
- return
@@ -6081,7 +6086,7 @@ example (void)
60816086
// acquire/create a promise object.
60826087
jerry_value_t promise = jerry_create_promise ();
60836088
{
6084-
// prepare the argumnent for the resolve or reject.
6089+
// prepare the argument for the resolve or reject.
60856090
jerry_value_t argument = jerry_create_number (33);
60866091

60876092
jerry_value_t is_ok = jerry_resolve_or_reject_promise (promise,
@@ -6153,7 +6158,7 @@ example (void)
61536158
// a Promise have a default state of JERRY_PROMISE_STATE_PENDING
61546159

61556160
{
6156-
// prepare the argumnent for the resolve or reject.
6161+
// prepare the argument for the resolve or reject.
61576162
jerry_value_t argument = jerry_create_number (33);
61586163

61596164
jerry_value_t is_ok = jerry_resolve_or_reject_promise (promise,
@@ -6384,7 +6389,7 @@ jerry_resolve_or_reject_promise (jerry_value_t promise,
63846389
- `argument` - the argument for resolve or reject
63856390
- `is_resolve` - whether the promise should be resolved or rejected
63866391
- return value
6387-
- undefined jerry value - resolve or reject successed
6392+
- undefined jerry value - success of resolve or reject
63886393
- jerry value with error flag - otherwise
63896394

63906395
*New in version 2.0*.
@@ -6400,7 +6405,7 @@ jerry_resolve_or_reject_promise (jerry_value_t promise,
64006405
...
64016406

64026407
bool is_resolve = ... // whether the promise should be resolved or rejected
6403-
jerry_value_t argument = ... // prepare the argumnent for the resolve or reject.
6408+
jerry_value_t argument = ... // prepare the argument for the resolve or reject.
64046409

64056410
jerry_value_t is_ok = jerry_resolve_or_reject_promise (promise,
64066411
argument,
@@ -6621,7 +6626,7 @@ These APIs all depend on build option (`JERRY_BUILTIN_BIGINT`).
66216626

66226627
Returns the size of uint64 digits of a BigInt value. This value is the
66236628
minimum size of the buffer which can hold all digits of a BigInt value when
6624-
the digits are retreived by `[jerry_get_bigint_digits](#jerry_get_bigint_digits)`.
6629+
the digits are retrieved by `[jerry_get_bigint_digits](#jerry_get_bigint_digits)`.
66256630

66266631
*Notes*:
66276632
- 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
70437048
- `buffer_p` - the backing store used by the array buffer object.
70447049
- `arraybuffer_user_p` - user pointer assigned to the array buffer object.
70457050
- return value
7046-
- value of the newly construced array buffer object.
7051+
- value of the newly constructed array buffer object.
70477052

70487053
*New in version 2.0*.
70497054

@@ -7146,7 +7151,7 @@ jerry_create_shared_arraybuffer_external (const jerry_length_t size
71467151
- `buffer_p` - the backing store used by the shared array buffer object.
71477152
- `arraybuffer_user_p` - user pointer assigned to the shared array buffer object.
71487153
- return value
7149-
- value of the newly construced shared array buffer object.
7154+
- value of the newly constructed shared array buffer object.
71507155

71517156
*New in version [[NEXT_RELEASE]]*.
71527157

@@ -9479,7 +9484,7 @@ method_setter (const jerry_call_info_t *call_info_p,
94799484
const jerry_length_t argc)
94809485
{
94819486
// Note: the arguments count and type should be checked
9482-
// in this example it is ommitted!
9487+
// in this example it is omitted!
94839488

94849489
double new_value = jerry_get_number_value (args[0]);
94859490
counter = (int) new_value;
@@ -10062,12 +10067,12 @@ main (void)
1006210067
shape_p->perimeter = 12;
1006310068
jerry_set_object_native_pointer (object, shape_p, &shape_obj_type_info);
1006410069

10065-
// The native pointer can be NULL. This gives possibily to get notified via the native type info's
10070+
// The native pointer can be NULL. This gives possibly to get notified via the native type info's
1006610071
// free callback when the object has been freed by the GC.
1006710072
jerry_set_object_native_pointer (object, NULL, &destructor_obj_type_info);
1006810073

1006910074
// The native type info can be NULL as well. In this case the registered property is simply freed
10070-
// when the object is freed by te GC.
10075+
// when the object is freed by the GC.
1007110076
jerry_set_object_native_pointer (object, SECRET_INFO, NULL);
1007210077

1007310078
do_stuff (object);
@@ -11083,7 +11088,7 @@ jerry_generate_snapshot (jerry_value_t compiled_code,
1108311088
- `buffer_p` - output buffer (aligned to 4 bytes) to save snapshot to.
1108411089
- `buffer_size` - the output buffer's size in bytes.
1108511090
- return value
11086-
- the size of the generated snapshot in bytes as number value, if it was generated succesfully (i.e. there
11091+
- the size of the generated snapshot in bytes as number value, if it was generated successfully (i.e. there
1108711092
are no syntax errors in source code, buffer size is sufficient, and snapshot support is enabled in
1108811093
current configuration through JERRY_SNAPSHOT_SAVE)
1108911094
- thrown error, otherwise.
@@ -11170,7 +11175,7 @@ jerry_exec_snapshot (const uint32_t *snapshot_p,
1117011175
- `snapshot_size` - size of snapshot in bytes.
1117111176
- `func_index` - index of executed function.
1117211177
- `exec_snapshot_opts` - any combination of [jerry_exec_snapshot_opts_t](#jerry_exec_snapshot_opts_t) flags.
11173-
- `options_values_p` - additional loadig options, can be NULL if not used. The fields are described in
11178+
- `options_values_p` - additional loading options, can be NULL if not used. The fields are described in
1117411179
[jerry_exec_snapshot_option_values_t](#jerry_exec_snapshot_option_values_t).
1117511180
- return value
1117611181
- result of bytecode, if run was successful.
@@ -11333,7 +11338,7 @@ jerry_get_literals_from_snapshot (const uint32_t *snapshot_p,
1133311338
- `lit_buf_size` - the buffer's size.
1133411339
- `is_c_format` - the output format would be C-style (true) or a simple list (false).
1133511340
- return value
11336-
- the size of the literal-list, if it was generated succesfully (i.e. the list of literals isn't empty,
11341+
- the size of the literal-list, if it was generated successfully (i.e. the list of literals isn't empty,
1133711342
and literal-save support is enabled in current configuration through JERRY_SNAPSHOT_SAVE)
1133811343
- 0 otherwise.
1133911344

@@ -11903,7 +11908,7 @@ backtrace_callback (jerry_backtrace_frame_t *frame_p,
1190311908
if (jerry_backtrace_is_strict (frame_p))
1190411909
{
1190511910
printf ("Strict mode code is running");
11906-
return truel
11911+
return true;
1190711912
}
1190811913

1190911914
printf ("Non-strict mode code is running");
@@ -12554,7 +12559,7 @@ jerry_arraybuffer_read (const jerry_value_t value,
1255412559
{
1255512560
uint8_t data[20];
1255612561
jerry_value_t buffer;
12557-
// ... create the ArrayBuffer or acuiqre it from somewhere.
12562+
// ... create the ArrayBuffer or acquire it from somewhere.
1255812563

1255912564
jerry_value_t bytes_read;
1256012565

@@ -13106,7 +13111,7 @@ jerry_get_typedarray_type (jerry_value_t value);
1310613111
```c
1310713112
{
1310813113
jerry_typedarray_type_t expected_type = JERRY_TYPEDARRAY_UINT32;
13109-
jerry_value_t typedarray = jerry_create_typedarray (expected_klass, 25);
13114+
jerry_value_t typedarray = jerry_create_typedarray (expected_class, 25);
1311013115

1311113116
jerry_typedarray_type_t type = jerry_get_typedarray_type (typedarray);
1311213117

@@ -13262,7 +13267,7 @@ main (void)
1326213267
const jerry_char_t data[] = "{\"name\": \"John\", \"age\": 5}";
1326313268
jerry_value_t obj = jerry_json_parse (data, sizeof (data) - 1);
1326413269

13265-
/* "obj" now conatins and object created from the "data" JSON string. */
13270+
/* "obj" now contains and object created from the "data" JSON string. */
1326613271

1326713272
jerry_release_value (obj);
1326813273

docs/04.INTERNALS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Argument combinations are limited to the following seven forms:
7878
## Literals
7979

8080
Literals are organized into groups whose represent various literal types. Having these groups consuming less space than assigning flag bits to each literal.
81-
(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`
81+
(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`
8282
and less than `literal_end`. If `ident_end` equals to `literal_end` the range is empty.)
8383

8484
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
271271

272272
[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.
273273

274-
![Object/Lexicat environment structures](img/ecma_object.png)
274+
![Object/Lexical environment structures](img/ecma_object.png)
275275

276276
The objects are represented as following structure:
277277

docs/05.PORT-API.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ typedef enum
7272
void jerry_port_log (jerry_log_level_t level, const char *fmt, ...);
7373
```
7474
75-
The `jerry_port_print_char` is currenlty not used by the jerry-core directly.
76-
However, it provides a port specifc way for `jerry-ext` components to print
75+
The `jerry_port_print_char` is currently not used by the jerry-core directly.
76+
However, it provides a port specific way for `jerry-ext` components to print
7777
information.
7878
7979
```c
@@ -284,7 +284,7 @@ void
284284
jerry_port_print_char (char c)
285285
{
286286
putchar (c);
287-
} /* jerr_port_print_char */
287+
} /* jerry_port_print_char */
288288
```
289289
290290
## Date

docs/08.CODING-STANDARDS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ is doing.
4646

4747
/* not a complete sentence */
4848

49-
/* A bad mulitiline
49+
/* A bad multiline
5050
comment. */
5151
```
5252

@@ -369,7 +369,7 @@ a = 6;
369369

370370
b = 7;
371371

372-
/* No newlines are allowed between control staments
372+
/* No newlines are allowed between control statements
373373
* and their code blocks. */
374374

375375
if (a > 6)
@@ -419,7 +419,7 @@ a=b+c;
419419
a = b+c;
420420
a += c + ( d );
421421
/* Introduce temporary variables or macros
422-
* if the expression is too long. Occures rarely.. */
422+
* if the expression is too long. Occurs rarely.. */
423423
a = b
424424
+ c;
425425
if ( a + b > 0 )

docs/10.EXT-REFERENCE-HANDLER.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ jerryx_has_property_str (const jerry_value_t target_object,
141141
- `target_object` - object on which the property name is accessed
142142
- `name` - property name as an UTF-8 `char*`
143143
- return value
144-
- true, if the given property name exsits on the object
144+
- true, if the given property name exists on the object
145145
- false, if there is no such property name or there was an error accessing the property
146146
147147
**Example**
@@ -180,7 +180,7 @@ for this the following utility structures and methods are provided.
180180
Structure to define an array of properties with `name` and `value` fields which
181181
can be registered to a target object.
182182

183-
The engine must be initialied before specifying the `jerry_value_t` in the struct.
183+
The engine must be initialized before specifying the `jerry_value_t` in the struct.
184184

185185

186186
**Prototype**
@@ -209,7 +209,7 @@ successfully registered methods.
209209
This must be passed for the [jerryx_release_property_entry](#jerryx_release_property_entry) method
210210
after the property registration.
211211

212-
If any error occured during the property registration the `result` field of the structure
212+
If any error occurred during the property registration the `result` field of the structure
213213
must be manually released after processing the error value.
214214

215215
**Prototype**
@@ -393,7 +393,7 @@ Release all `jerry_value_t` in a `jerryx_property_entry` array based on a previo
393393
and also the error value (if any) in the `jerryx_register_result` structure.
394394
In case of a successful registration it is safe to call this method.
395395
396-
After the method call the `ęntries` array should not be used as all values are released.
396+
After the method call the `entries` array should not be used as all values are released.
397397
398398
**Prototype**
399399
@@ -403,7 +403,7 @@ jerryx_release_property_entry (const jerryx_property_entry entries[],
403403
const jerryx_register_result register_result);
404404
```
405405
406-
- `entires` - array of [jerryx_property_entry](#jerryx_property_entry).
406+
- `entries` - array of [jerryx_property_entry](#jerryx_property_entry).
407407
- `register_result` - result of a previous [jerryx_set_properties](#jerryx_set_properties) call.
408408
409409
**Example**
@@ -513,7 +513,7 @@ jerryx_handler_gc (const jerry_value_t func_obj_val, const jerry_value_t this_p,
513513

514514
Provide a `print` implementation for scripts. The routine converts all of its
515515
arguments to strings and outputs them char-by-char using
516-
`jerry_port_print_char`. The NUL character is output as "\u0000",
516+
`jerry_port_print_char`. The NULL character is output as "\u0000",
517517
other characters are output bytewise.
518518

519519
*Note*: This implementation does not use standard C `printf` to print its

0 commit comments

Comments
 (0)