Improve jerry_is_feature_enabled with object availability information (#2250)

JerryScript-DCO-1.0-Signed-off-by: Zsolt Raduska rzsolt@inf.u-szeged.hu
This commit is contained in:
ZsoltRaduska
2018-04-05 09:54:07 +02:00
committed by László Langó
parent f06d637238
commit 0476523f1a
3 changed files with 25 additions and 0 deletions
+5
View File
@@ -53,6 +53,11 @@ Possible compile time enabled feature types:
- JERRY_FEATURE_SNAPSHOT_EXEC - executing snapshot files
- JERRY_FEATURE_DEBUGGER - debugging
- JERRY_FEATURE_VM_EXEC_STOP - stopping ECMAScript execution
- JERRY_FEATURE_JSON - JSON support
- JERRY_FEATURE_PROMISE - promise support
- JERRY_FEATURE_TYPEDARRAY - Typedarray support
- JERRY_FEATURE_DATE - Date support
- JERRY_FEATURE_REGEXP - RegExp support
## jerry_char_t
+15
View File
@@ -864,6 +864,21 @@ bool jerry_is_feature_enabled (const jerry_feature_t feature)
#ifdef JERRY_VM_EXEC_STOP
|| feature == JERRY_FEATURE_VM_EXEC_STOP
#endif /* JERRY_VM_EXEC_STOP */
#ifndef CONFIG_DISABLE_JSON_BUILTIN
|| feature == JERRY_FEATURE_JSON
#endif /* !CONFIG_DISABLE_JSON_BUILTIN */
#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
|| feature == JERRY_FEATURE_PROMISE
#endif /* !CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
#ifndef CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
|| feature == JERRY_FEATURE_TYPEDARRAY
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
#ifndef CONFIG_DISABLE_DATE_BUILTIN
|| feature == JERRY_FEATURE_DATE
#endif /* !CONFIG_DISABLE_DATE_BUILTIN */
#ifndef CONFIG_DISABLE_REGEXP_BUILTIN
|| feature == JERRY_FEATURE_REGEXP
#endif /* !CONFIG_DISABLE_REGEXP_BUILTIN */
);
} /* jerry_is_feature_enabled */
+5
View File
@@ -90,6 +90,11 @@ typedef enum
JERRY_FEATURE_SNAPSHOT_EXEC, /**< executing snapshot files */
JERRY_FEATURE_DEBUGGER, /**< debugging */
JERRY_FEATURE_VM_EXEC_STOP, /**< stopping ECMAScript execution */
JERRY_FEATURE_JSON, /**< JSON support */
JERRY_FEATURE_PROMISE, /**< promise support */
JERRY_FEATURE_TYPEDARRAY, /**< Typedarray support */
JERRY_FEATURE_DATE, /**< Date support */
JERRY_FEATURE_REGEXP, /**< Regexp support */
JERRY_FEATURE__COUNT /**< number of features. NOTE: must be at the end of the list */
} jerry_feature_t;