Add API function to check if the specified feature is enabled. (#1465)

JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
This commit is contained in:
Robert Sipka
2016-12-05 09:26:02 +01:00
committed by GitHub
parent 4c1fc7d789
commit 4ef3c0caa8
3 changed files with 96 additions and 0 deletions
+44
View File
@@ -22,6 +22,18 @@ Possible types of an error:
- JERRY_ERROR_TYPE - type error
- JERRY_ERROR_URI - URI error
## jerry_feature_t
Possible compile time enabled feature types:
- JERRY_FEATURE_ERROR_MESSAGES - error messages
- JERRY_FEATURE_CPOINTER_32_BIT - 32 bit compressed pointers
- JERRY_FEATURE_MEM_STATS - memory statistics
- JERRY_FEATURE_PARSER_DUMP - parser byte-code dumps
- JERRY_FEATURE_REGEXP_DUMP - regexp byte-code dumps
- JERRY_FEATURE_SNAPSHOT_SAVE - saving snapshot files
- JERRY_FEATURE_SNAPSHOT_EXEC - executing snapshot files
## jerry_char_t
**Summary**
@@ -917,6 +929,38 @@ jerry_value_is_undefined (const jerry_value_t value)
- [jerry_release_value](#jerry_release_value)
## jerry_is_feature_enabled
**Summary**
Returns whether the specified compile time feature is enabled.
**Prototype**
```c
bool
jerry_is_feature_enabled (const jerry_feature_t feature);
```
- `feature` - jerry feature
- return value
- true, if the given `jerry_feature_t` is enabled
- false, otherwise
**Example**
```c
{
...
jerry_feature_t feature = JERRY_FEATURE_SNAPSHOT_SAVE;
if (jerry_is_feature_enabled (feature))
{
...
}
}
```
# Error flag manipulation functions