Skip to content

Commit

Permalink
Rework the public API
Browse files Browse the repository at this point in the history
Related to jerryscript-project#4186.

Some notable changes:
  - The term 'Error' now strictly refers to native Error objects defined in
    the ECMA standard, which are ordinary objects. All other uses of
    'error' or 'error reference' where the term refers to a thrown value is
    now called 'exception'.

  - Simplified the naming scheme of many String API functions. These functions
    will now also take an 'encoding' argument to specify the desired
    encoding in which to operate.

  - Removed the substring-copy-to-buffer functions. These functions
    behaved awkwardly, as they use character index to specify the
    start/end positions, and were mostly used incorrectly with byte
    offsets instead. The functionality can still be replicated with
    other functions if necessary.

  - String-to-buffer functions will no longer fail if the buffer is not
    sufficiently large, the string will instead be cropped.

  - Fixed the usage of the '_sz' prefix in many API functions. The term
    'sz' means zero-terminated string in hungarian notation, this was
    used incorrectly in many cases.

  - Renamed most of the public API functions to have shorter, more on-point
    names, rather than the often too long descriptive names. Functions are now
    also grouped by the type of value they operate on, where this makes
    sense.

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
  • Loading branch information
dbatyai committed Dec 2, 2021
1 parent a1c1d42 commit 7cc3db6
Show file tree
Hide file tree
Showing 180 changed files with 10,589 additions and 10,867 deletions.
2 changes: 1 addition & 1 deletion docs/01.CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ This option is enabled by default.

### Memory statistics

This option can be used to provide memory usage statistics either upon engine termination, or during runtime using the `jerry_get_memory_stats` jerry API function.
This option can be used to provide memory usage statistics either upon engine termination, or during runtime using the `jerry_heap_stats` jerry API function.
The feature can create a significant performance overhead, and should only be used for measurement purposes. This option is disabled by default.

| Options | |
Expand Down
4,882 changes: 2,221 additions & 2,661 deletions docs/02.API-REFERENCE.md

Large diffs are not rendered by default.

Loading

0 comments on commit 7cc3db6

Please sign in to comment.