Update the webpage (#2037)

JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
This commit is contained in:
Zsolt Borbély
2017-10-04 15:43:22 +02:00
committed by GitHub
parent 7ff37da735
commit 962807a13f
3 changed files with 283 additions and 75 deletions
+48 -11
View File
@@ -677,7 +677,7 @@ jerry_parse (const jerry_char_t *source_p,
bool is_strict);
```
- `source_p` - string, containing source code to parse. It must be a valid utf8 string.
- `source_p` - string, containing source code to parse (must be a valid UTF8 string).
- `source_size` - size of the string, in bytes.
- `is_strict` - defines strict mode.
- return value
@@ -716,8 +716,8 @@ main (void)
**Summary**
Parse script and construct an ECMAScript function. The lexical
environment is set to the global lexical environment. The name
(usually a file name) is also passed to this function which is
environment is set to the global lexical environment. The resource
name (usually a file name) is also passed to this function which is
used by the debugger to find the source code.
*Note*: The returned value must be freed with [jerry_release_value](#jerry_release_value) when it
@@ -727,25 +727,62 @@ is no longer needed.
```c
jerry_value_t
jerry_parse_named_resource (const jerry_char_t *name_p, /**< name (usually a file name) */
size_t name_length, /**< length of name */
jerry_parse_named_resource (const jerry_char_t *resource_name_p, /**< resource name (usually a file name) */
size_t resource_name_length, /**< length of resource name */
const jerry_char_t *source_p, /**< script source */
size_t source_size, /**< script source size */
bool is_strict) /**< strict mode */
{
```
- `name_p` - name, usually a file name
- `name_length` - size of the file name, in bytes
- `source_p` - string, containing source code to parse. It must be a valid UTF8 string
- `source_size` - size of the string, in bytes
- `is_strict` - defines strict mode
- `resource_name_p` - resource name, usually a file name (must be a valid UTF8 string).
- `resource_name_length` - size of the resource name, in bytes.
- `source_p` - string, containing source code to parse (must be a valid UTF8 string).
- `source_size` - size of the string, in bytes.
- `is_strict` - defines strict mode.
- return value
- function object value, if script was parsed successfully,
- thrown error, otherwise
This function is identical to [jerry_parse](#jerry_parse), except that an additional filename parameter has been added.
## jerry_parse_function
**Summary**
Parse function source code and construct an ECMAScript
function. The function arguments and function body are
passed as separated arguments. The lexical environment
is set to the global lexical environment. The resource
name (usually a file name) is also passed to this function
which is used by the debugger to find the source code.
*Note*: The returned value must be freed with [jerry_release_value](#jerry_release_value) when it
is no longer needed.
**Prototype**
```c
jerry_value_t
jerry_parse_function (const jerry_char_t *resource_name_p, /**< resource name (usually a file name) */
size_t resource_name_length, /**< length of resource name */
const jerry_char_t *arg_list_p, /**< script source */
size_t arg_list_size, /**< script source size */
const jerry_char_t *source_p, /**< script source */
size_t source_size, /**< script source size */
bool is_strict) /**< strict mode */
```
- `resource_name_p` - resource name, usually a file name (must be a valid UTF8 string).
- `resource_name_length` - size of the resource name, in bytes.
- `arg_list_p` - argument list of the function (must be a valid UTF8 string).
- `arg_list_size` - size of the argument list, in bytes.
- `source_p` - string, containing source code to parse (must be a valid UTF8 string).
- `source_size` - size of the string, in bytes.
- `is_strict` - defines strict mode.
- return value
- function object value, if script was parsed successfully,
- thrown error, otherwise
## jerry_run
**Summary**