Update the webpage (#2692)
JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
This commit is contained in:
committed by
László Langó
parent
c2b32a83cd
commit
de6dab0e48
+84
-4
@@ -72,6 +72,16 @@ Possible compile time enabled feature types:
|
||||
- JERRY_FEATURE_LINE_INFO - line info available
|
||||
- JERRY_FEATURE_LOGGING - logging
|
||||
|
||||
## jerry_regexp_flags_t
|
||||
|
||||
RegExp object optional flags:
|
||||
|
||||
- JERRY_REGEXP_FLAG_GLOBAL - global match; find all matches rather than stopping after the first match
|
||||
- JERRY_REGEXP_FLAG_IGNORE_CASE - ignore case
|
||||
- JERRY_REGEXP_FLAG_MULTILINE - multiline; treat beginning and end characters (^ and $) as working over
|
||||
multiple lines (i.e., match the beginning or end of each line (delimited by \n or \r), not only the
|
||||
very beginning or end of the whole input string)
|
||||
|
||||
## jerry_parse_opts_t
|
||||
|
||||
Option bits for [jerry_parse](#jerry_parse) and
|
||||
@@ -3416,6 +3426,76 @@ jerry_create_string_sz (const jerry_char_t *str_p,
|
||||
- [jerry_create_string_from_utf8](#jerry_create_string_from_utf8)
|
||||
|
||||
|
||||
## jerry_create_regexp
|
||||
|
||||
**Summary**
|
||||
|
||||
Returns a jerry_value_t RegExp object or an error, if the construction of the object fails.
|
||||
Optional flags can be set using [jerry_regexp_flags_t](#jerry_regexp_flags_t).
|
||||
These flags can be combined together with the binary OR operator or used on their own as enum values.
|
||||
|
||||
**Prototype**
|
||||
```c
|
||||
jerry_value_t
|
||||
jerry_create_regexp (const jerry_char_t *pattern_p, uint16_t flags);
|
||||
```
|
||||
|
||||
- `pattern_p` - the RegExp pattern as a zero-terminated UTF-8 string
|
||||
- `flags` - optional flags for the RegExp object, see [jerry_regexp_flags_t](#jerry_regexp_flags_t)
|
||||
- return value - the RegExp object as a `jerry_value_t`
|
||||
|
||||
**Example**
|
||||
|
||||
```c
|
||||
{
|
||||
jerry_char_t pattern_p = "[cgt]gggtaaa|tttaccc[acg]";
|
||||
uint16_t pattern_flags = JERRY_REGEXP_FLAG_IGNORE_CASE;
|
||||
|
||||
jerry_value_t regexp = jerry_create_regexp (pattern_p, pattern_flags);
|
||||
|
||||
...
|
||||
|
||||
jerry_release_value (regexp);
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## jerry_create_regexp_sz
|
||||
|
||||
**Summary**
|
||||
|
||||
Returns a jerry_value_t RegExp object or an error, if the construction of the object fails.
|
||||
Optional flags can be set using [jerry_regexp_flags_t](#jerry_regexp_flags_t).
|
||||
These flags can be combined together with the binary OR operator or used on their own as enum values.
|
||||
|
||||
**Prototype**
|
||||
```c
|
||||
jerry_value_t
|
||||
jerry_create_regexp_sz (const jerry_char_t *pattern_p, jerry_size_t pattern_size, uint16_t flags);
|
||||
```
|
||||
|
||||
- `pattern_p` - the RegExp pattern as a zero-terminated UTF-8 string
|
||||
- `pattern_size` - size of the `pattern`
|
||||
- `flags` - optional flags for the RegExp object, see [jerry_regexp_flags_t](#jerry_regexp_flags_t)
|
||||
- return value - the RegExp object as a `jerry_value_t`
|
||||
|
||||
**Example**
|
||||
|
||||
```c
|
||||
{
|
||||
jerry_char_t pattern_p = "[cgt]gggtaaa|tttaccc[acg]";
|
||||
jerry_size_t pattern_size = sizeof (pattern_p) - 1;
|
||||
uint16_t pattern_flags = JERRY_REGEXP_FLAG_IGNORE_CASE;
|
||||
|
||||
jerry_value_t regexp = jerry_create_regexp_sz (pattern_p, pattern_size, pattern_flags);
|
||||
|
||||
...
|
||||
|
||||
jerry_release_value (regexp);
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## jerry_create_typedarray
|
||||
|
||||
**Summary**
|
||||
@@ -3802,7 +3882,7 @@ jerry_get_property (const jerry_value_t obj_val,
|
||||
jerry_value_t global_object = jerry_get_global_object ();
|
||||
jerry_value_t prop_name = jerry_create_string ((const jerry_char_t *) "my_prop");
|
||||
|
||||
jerry_value_t prop_value = jerry_get_property (obj_val, prop_name);
|
||||
jerry_value_t prop_value = jerry_get_property (global_object, prop_name);
|
||||
|
||||
jerry_release_value (prop_name);
|
||||
jerry_release_value (global_object);
|
||||
@@ -5923,7 +6003,7 @@ jerry_value_t jerry_json_parse (const jerry_char_t *string_p, jerry_size_t strin
|
||||
}
|
||||
```
|
||||
|
||||
## jerry_stringify
|
||||
## jerry_json_stringify
|
||||
|
||||
**Summary**
|
||||
|
||||
@@ -5932,7 +6012,7 @@ jerry_value_t jerry_json_parse (const jerry_char_t *string_p, jerry_size_t strin
|
||||
**Prototype**
|
||||
|
||||
```c
|
||||
jerry_value_t jerry_json_stringfy (const jerry_value_t object_to_stringify)
|
||||
jerry_value_t jerry_json_stringify (const jerry_value_t object_to_stringify)
|
||||
```
|
||||
|
||||
- `object_to_stringify` - a jerry_value_t object to stringify
|
||||
@@ -5948,7 +6028,7 @@ jerry_value_t jerry_json_stringfy (const jerry_value_t object_to_stringify)
|
||||
jerry_value_t key = jerry_create_string ((const jerry_char_t *) "name");
|
||||
jerry_value_t value = jerry_create_string ((const jerry_char_t *) "John");
|
||||
jerry_set_property (obj, key, value);
|
||||
jerry_value_t stringified = jerry_json_stringfy (obj);
|
||||
jerry_value_t stringified = jerry_json_stringify (obj);
|
||||
|
||||
//stringified now contains a json formated string
|
||||
|
||||
|
||||
Reference in New Issue
Block a user