Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 18 additions & 14 deletions docs/02.API-REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,8 @@ jerry_run_simple (const jerry_char_t *script_source,

**Summary**

Parse specified script to execute in Global scope.
Parse script and construct an EcmaScript function. The
lexical environment is set to the global lexical environment.

*Note*: Returned value must be freed with [jerry_release_value](#jerry_release_value) when it
is no longer needed.
Expand Down Expand Up @@ -425,7 +426,7 @@ jerry_parse (const jerry_char_t *source_p,

**Summary**

Run code in Global scope.
Run an EcmaScript function created by jerry_parse.

*Note*: The code should be previously parsed with `jerry_parse`.

Expand Down Expand Up @@ -1102,7 +1103,7 @@ jerry_get_number_value (const jerry_value_t value);

**Summary**

Get the size of a string. Returns zero, if the specified string is not a value.
Get the size of a string. Returns zero, if the value parameter is not a string.

**Prototype**

Expand Down Expand Up @@ -1138,7 +1139,7 @@ jerry_get_string_size (const jerry_value_t value);

**Summary**

Get the length of a string. Returns zero, if the specified string is not a value.
Get the length of a string. Returns zero, if the value parameter is not a string.

**Prototype**

Expand Down Expand Up @@ -1175,10 +1176,10 @@ jerry_get_string_length (const jerry_value_t value);

**Summary**

Copy string characters to specified buffer. It is the caller's responsibility to make sure that
the string fits in the buffer.

*Note*: '\0' could occur in characters.
Copy the characters of a string into a specified buffer. The
'\0' character could occur in character buffer. Returns 0,
if the value parameter is not a string or the buffer is
not large enough for the whole string.

**Prototype**

Expand Down Expand Up @@ -1933,7 +1934,7 @@ jerry_create_undefined (void);

**Summary**

Checks whether the object or it's prototype has the given property.
Checks whether the object or it's prototype objects have the given property.

**Prototype**

Expand Down Expand Up @@ -2436,7 +2437,8 @@ jerry_free_property_descriptor_fields (const jerry_property_descriptor_t *prop_d

**Summary**

Call function specified by a function value.
Call function specified by a function value. Error flag
must not be set for any arguments of this function.

*Note*: Returned value must be freed with [jerry_release_value](#jerry_release_value) when it
is no longer needed.
Expand Down Expand Up @@ -2492,6 +2494,7 @@ jerry_call_function (const jerry_value_t func_obj_val,
**Summary**

Construct object, invoking specified function object as constructor.
Error flag must not be set for any arguments of this function.

*Note*: Returned value must be freed with [jerry_release_value](#jerry_release_value) when it
is no longer needed.
Expand Down Expand Up @@ -2704,13 +2707,14 @@ jerry_get_object_native_handle (const jerry_value_t obj_val,

**Summary**

Set native handle and, optionally, free callback for the specified object
Set native handle and an optional free callback for the specified object

*Note*: If native handle was already set for the object, its value is updated.

*Note*: If free callback is specified, it is set to be called upon specified JS-object is freed (by GC).
Otherwise, if NULL is specified for free callback pointer, free callback is not created and, if
a free callback was added earlier for the object, it is removed.
*Note*: If a non-NULL free callback is specified, it will be called
by the garbage collector when the object is freed. The free
callback always overwrites the previous value, so passing
a NULL value deletes the current free callback.

**Prototype**

Expand Down
3 changes: 1 addition & 2 deletions jerry-core/ecma/operations/ecma-lex-env.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,13 @@ ecma_finalize_environment (void)

/**
* Get reference to Global lexical environment
* without increasing its reference count.
*
* @return pointer to the object's instance
*/
ecma_object_t *
ecma_get_global_environment (void)
{
ecma_ref_object (ecma_global_lex_env_p);

return ecma_global_lex_env_p;
} /* ecma_get_global_environment */

Expand Down
Loading