diff --git a/docs/02.API-REFERENCE.md b/docs/02.API-REFERENCE.md index dec8efa089..08b7cbffcf 100644 --- a/docs/02.API-REFERENCE.md +++ b/docs/02.API-REFERENCE.md @@ -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 diff --git a/jerry-core/api/jerry.c b/jerry-core/api/jerry.c index 5b3d164c47..773073b692 100644 --- a/jerry-core/api/jerry.c +++ b/jerry-core/api/jerry.c @@ -865,6 +865,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 */ diff --git a/jerry-core/include/jerryscript-core.h b/jerry-core/include/jerryscript-core.h index e58b7d644c..560a30f27b 100644 --- a/jerry-core/include/jerryscript-core.h +++ b/jerry-core/include/jerryscript-core.h @@ -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;