Repository: jerryscript-project/jerryscript
File: jerry-core/include/jerryscript-core.h (C/C++)

Code before:
  JERRY_FUNCTION_TYPE_NONE = 0u,    /**< Non function type */
  JERRY_FUNCTION_TYPE_GENERIC,      /**< Generic JavaScript function */
  JERRY_FUNCTION_TYPE_ACCESSOR,     /**< Accessor function */
  JERRY_FUNCTION_TYPE_BOUND,        /**< Bound function */
  JERRY_FUNCTION_TYPE_ARROW,        /**< Arrow fuction */
  JERRY_FUNCTION_TYPE_GENERATOR,    /**< Generator function */
} jerry_function_type_t;

/**
 * JerryScript iterator object type information.
 */
typedef enum
{
  JERRY_ITERATOR_TYPE_NONE = 0u,    /**< Non iterator type */
  JERRY_ITERATOR_TYPE_ARRAY,        /**< Array iterator */
  JERRY_ITERATOR_TYPE_STRING,       /**< String iterator */
  JERRY_ITERATOR_TYPE_MAP,          /**< Map iterator */
  JERRY_ITERATOR_TYPE_SET,          /**< Set iterator */
} jerry_iterator_type_t;

/**
 * JerryScript object property filter options.
 */
typedef enum
{
  JERRY_PROPERTY_FILTER_ALL = 0,                               /**< List all property keys independently
                                                                *   from key type or property value attributes
                                                                *   (equivalent to Reflect.ownKeys call)  */
  JERRY_PROPERTY_FILTER_TRAVERSE_PROTOTYPE_CHAIN = (1 << 0),   /**< Include keys from the objects's
                                                                *   prototype chain as well */
  JERRY_PROPERTY_FILTER_EXLCUDE_NON_CONFIGURABLE = (1 << 1),   /**< Exclude property key if
                                                                *   the property is non-configurable */
  JERRY_PROPERTY_FILTER_EXLCUDE_NON_ENUMERABLE = (1 << 2),     /**< Exclude property key if
                                                                *   the property is non-enumerable */
  JERRY_PROPERTY_FILTER_EXLCUDE_NON_WRITABLE = (1 << 3),       /**< Exclude property key if
                                                                *   the property is non-writable */
  JERRY_PROPERTY_FILTER_EXLCUDE_STRINGS = (1 << 4),            /**< Exclude property key if it is a string */
  JERRY_PROPERTY_FILTER_EXLCUDE_SYMBOLS = (1 << 5),            /**< Exclude property key if it is a symbol */
  JERRY_PROPERTY_FILTER_EXLCUDE_INTEGER_INDICES = (1 << 6),    /**< Exclude property key if it is an integer index */
  JERRY_PROPERTY_FILTER_INTEGER_INDICES_AS_NUMBER = (1 << 7),  /**< By default integer index property keys are
                                                                *   converted to string. Enabling this flags keeps
                                                                *   integer index property keys as numbers. */
} jerry_property_filter_t;

jerry_type_t jerry_value_get_type (const jerry_value_t value);
jerry_object_type_t jerry_object_get_type (const jerry_value_t value);
jerry_function_type_t jerry_function_get_type (const jerry_value_t value);
jerry_iterator_type_t jerry_iterator_get_type (const jerry_value_t value);

/**
 * Checker function of whether the specified compile feature is enabled.

Review comment (suggestion):
It would be good to have a NULL value at the start. or something like JERRY_PROXY_ALL_CHECKS. The main reason would be to not have the "0" as a value which can disable things.

Code after:
  JERRY_FUNCTION_TYPE_NONE = 0u,    /**< Non function type */
  JERRY_FUNCTION_TYPE_GENERIC,      /**< Generic JavaScript function */
  JERRY_FUNCTION_TYPE_ACCESSOR,     /**< Accessor function */
  JERRY_FUNCTION_TYPE_BOUND,        /**< Bound function */
  JERRY_FUNCTION_TYPE_ARROW,        /**< Arrow fuction */
  JERRY_FUNCTION_TYPE_GENERATOR,    /**< Generator function */
} jerry_function_type_t;

/**
 * JerryScript iterator object type information.
 */
typedef enum
{
  JERRY_ITERATOR_TYPE_NONE = 0u,    /**< Non iterator type */
  JERRY_ITERATOR_TYPE_ARRAY,        /**< Array iterator */
  JERRY_ITERATOR_TYPE_STRING,       /**< String iterator */
  JERRY_ITERATOR_TYPE_MAP,          /**< Map iterator */
  JERRY_ITERATOR_TYPE_SET,          /**< Set iterator */
} jerry_iterator_type_t;

/**
 * JerryScript special Proxy object options.
 */
typedef enum
{
  JERRY_PROXY_SKIP_GET_CHECKS = (1u << 0), /**< skip [[Get]] result checks */
  JERRY_PROXY_SKIP_GET_OWN_PROPERTY_CHECKS = (1u << 1), /**< skip [[GetOwnProperty]] result checks */
} jerry_proxy_object_options_t;

/**
 * JerryScript object property filter options.
 */
typedef enum
{
  JERRY_PROPERTY_FILTER_ALL = 0,                               /**< List all property keys independently
                                                                *   from key type or property value attributes
                                                                *   (equivalent to Reflect.ownKeys call)  */
  JERRY_PROPERTY_FILTER_TRAVERSE_PROTOTYPE_CHAIN = (1 << 0),   /**< Include keys from the objects's
                                                                *   prototype chain as well */
  JERRY_PROPERTY_FILTER_EXLCUDE_NON_CONFIGURABLE = (1 << 1),   /**< Exclude property key if
                                                                *   the property is non-configurable */
  JERRY_PROPERTY_FILTER_EXLCUDE_NON_ENUMERABLE = (1 << 2),     /**< Exclude property key if
                                                                *   the property is non-enumerable */
  JERRY_PROPERTY_FILTER_EXLCUDE_NON_WRITABLE = (1 << 3),       /**< Exclude property key if
                                                                *   the property is non-writable */
  JERRY_PROPERTY_FILTER_EXLCUDE_STRINGS = (1 << 4),            /**< Exclude property key if it is a string */
  JERRY_PROPERTY_FILTER_EXLCUDE_SYMBOLS = (1 << 5),            /**< Exclude property key if it is a symbol */
  JERRY_PROPERTY_FILTER_EXLCUDE_INTEGER_INDICES = (1 << 6),    /**< Exclude property key if it is an integer index */
  JERRY_PROPERTY_FILTER_INTEGER_INDICES_AS_NUMBER = (1 << 7),  /**< By default integer index property keys are
                                                                *   converted to string. Enabling this flags keeps
                                                                *   integer index property keys as numbers. */