Repository: jerryscript-project/jerryscript
File: jerry-core/ecma/base/ecma-globals.h (C/C++)

Code before:
 */
#define ECMA_CHECK_STACK_USAGE()
#endif /* (JERRY_STACK_LIMIT != 0) */

/**
 * Invalid object pointer which represents abrupt completion
 */
#define ECMA_OBJECT_POINTER_ERROR ((ecma_object_t *) 0x01)

/**
 * Invalid property pointer which represents abrupt completion
 */
#define ECMA_PROPERTY_POINTER_ERROR ((ecma_property_t *) 0x01)

#if ENABLED (JERRY_BUILTIN_PROXY)
/**
 * Description of Proxy objects.
 *
 * A Proxy object's property list is used to store extra information:
 *  * The "header.u2.prototype_cp" 1st tag bit stores the IsCallable information.
 *  * The "header.u2.prototype_cp" 2nd tag bit stores the IsConstructor information.
 */
typedef struct
{
  ecma_object_t header; /**< header part */
  ecma_value_t target; /**< [[ProxyTarget]] internal slot */
  ecma_value_t handler; /**< [[ProxyHandler]] internal slot */
} ecma_proxy_object_t;

/**
 * Description of Proxy objects.
 */
typedef struct
{
  ecma_extended_object_t header; /**< header part */
  ecma_value_t proxy; /**< [[RevocableProxy]] internal slot */
} ecma_revocable_proxy_object_t;
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */

#if ENABLED (JERRY_ESNEXT)
/**
 * Type to repesent the maximum property index
 *
 * For ES6+ the maximum valid property index is 2**53 - 1
 */
typedef uint64_t ecma_length_t;
#else /* !ENABLED (JERRY_ESNEXT) */
/**
 * Type to repesent the maximum property index
 *
 * For ES5+ the maximum valid property index is 2**32 - 1

Review comment (suggestion):
* The comment below is now invalid for the callable/constructable elements.
* The two always "used" flags should be the first ones (ECMA_PROXY_IS_CALLABLE, ECMA_PROXY_IS_CONSTRUCTABLE) these will never change, however later on if we add other skip it would look strange having the two is flags between them,

Code after:
 */
#define ECMA_CHECK_STACK_USAGE()
#endif /* (JERRY_STACK_LIMIT != 0) */

/**
 * Invalid object pointer which represents abrupt completion
 */
#define ECMA_OBJECT_POINTER_ERROR ((ecma_object_t *) 0x01)

/**
 * Invalid property pointer which represents abrupt completion
 */
#define ECMA_PROPERTY_POINTER_ERROR ((ecma_property_t *) 0x01)

#if ENABLED (JERRY_BUILTIN_PROXY)

/**
 * Proxy object flags.
 */
typedef enum
{
  ECMA_PROXY_SKIP_GET_CHECKS = (1u << 0), /**< skip [[Get]] result checks */
  ECMA_PROXY_SKIP_GET_OWN_PROPERTY_CHECKS = (1u << 1), /**< skip [[GetOwnProperty]] result checks */
  ECMA_PROXY_IS_CALLABLE = (1u << 2), /**< proxy is callable */
  ECMA_PROXY_IS_CONSTRUCTABLE = (1u << 3), /**< proxy is constructable */
} ecma_proxy_flag_types_t;

/**
 * Description of Proxy objects.
 *
 * A Proxy object's property list is used to store extra information:
 *  * The "header.u2.prototype_cp" 1st tag bit stores the IsCallable information.
 *  * The "header.u2.prototype_cp" 2nd tag bit stores the IsConstructor information.
 */
typedef struct
{
  ecma_object_t header; /**< header part */
  ecma_value_t target; /**< [[ProxyTarget]] internal slot */
  ecma_value_t handler; /**< [[ProxyHandler]] internal slot */
} ecma_proxy_object_t;

/**
 * Description of Proxy objects.
 */
typedef struct
{
  ecma_extended_object_t header; /**< header part */
  ecma_value_t proxy; /**< [[RevocableProxy]] internal slot */
} ecma_revocable_proxy_object_t;
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */