Correctly handle the Proxy IsCallable and IsConstructor information (#4264)

The `IsCallable(target)` and `IsConstructor(target)` info
can't be stored in the target/handler values.
If the input for the ProxyCreate was a revocable Proxy the original target's
callable/constructor information must be retained even after the
Proxy was revoked.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
This commit is contained in:
Péter Gál
2020-11-17 10:38:25 +01:00
committed by GitHub
parent 7262b98021
commit 5d916fb8d4
6 changed files with 99 additions and 8 deletions
@@ -106,7 +106,7 @@ ecma_op_object_is_callable (ecma_object_t *obj_p) /**< ecma object */
#if ENABLED (JERRY_BUILTIN_PROXY)
if (ECMA_OBJECT_TYPE_IS_PROXY (type))
{
return ecma_op_is_callable (((ecma_proxy_object_t *) obj_p)->target);
return ECMA_GET_FIRST_BIT_FROM_POINTER_TAG (obj_p->u1.property_list_cp) != 0;
}
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
@@ -159,7 +159,7 @@ ecma_object_is_constructor (ecma_object_t *obj_p) /**< ecma object */
#if ENABLED (JERRY_BUILTIN_PROXY)
if (ECMA_OBJECT_TYPE_IS_PROXY (type))
{
return ecma_is_constructor (((ecma_proxy_object_t *) obj_p)->target);
return ECMA_GET_SECOND_BIT_FROM_POINTER_TAG (obj_p->u1.property_list_cp) != 0;
}
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */