Add non-standard behaviour support for Proxies (#4562)

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2021-02-04 15:58:16 +01:00
committed by GitHub
parent e9df2ca814
commit 9ca046b670
12 changed files with 292 additions and 21 deletions
+1 -5
View File
@@ -887,9 +887,7 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
case ECMA_OBJECT_TYPE_PROXY:
{
ecma_gc_mark_proxy_object (object_p);
/* The protoype of the proxy should be "empty" (aside from the tag bits every other bit should be zero). */
JERRY_ASSERT ((object_p->u2.prototype_cp & ~JMEM_TAG_MASK) == 0);
/* Make sure that the prototype is not checked below. */
/* Prototype of proxy object is a bit set. */
proto_cp = JMEM_CP_NULL;
break;
}
@@ -1696,8 +1694,6 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
#if ENABLED (JERRY_BUILTIN_PROXY)
case ECMA_OBJECT_TYPE_PROXY:
{
/* The protoype of the proxy should be "empty" (aside from the tag bits every other bit should be zero). */
JERRY_ASSERT ((object_p->u2.prototype_cp & ~JMEM_TAG_MASK) == 0);
ext_object_size = sizeof (ecma_proxy_object_t);
break;
}
+12
View File
@@ -2176,6 +2176,18 @@ do \
#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.
*