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', where it refers to a thrown value (called error reference) 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 Nov 19, 2021
1 parent 4592143 commit b00b5af
Show file tree
Hide file tree
Showing 158 changed files with 10,021 additions and 10,337 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,638 changes: 2,105 additions & 2,533 deletions docs/02.API-REFERENCE.md

Large diffs are not rendered by default.

Loading

0 comments on commit b00b5af

Please sign in to comment.