Handle revoked Proxy during [[Get]] operation (#4349)
The handling of Proxy.[[Get]] was not fully correctly in the case when the Proxy was revoked during the execution of the handler. JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.usz@partner.samsung.com
This commit is contained in:
@@ -920,6 +920,19 @@ ecma_op_get_prototype_from_constructor (ecma_object_t *ctor_obj_p, /**< construc
|
||||
if (!ecma_is_value_object (proto))
|
||||
{
|
||||
ecma_free_value (proto);
|
||||
|
||||
#if ENABLED (JERRY_BUILTIN_PROXY)
|
||||
if (ECMA_OBJECT_IS_PROXY (ctor_obj_p))
|
||||
{
|
||||
ecma_proxy_object_t *proxy_obj_p = (ecma_proxy_object_t *) ctor_obj_p;
|
||||
if (ecma_is_value_null (proxy_obj_p->handler))
|
||||
{
|
||||
ecma_raise_type_error (ECMA_ERR_MSG ("Prototype from revoked Proxy is invalid."));
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
|
||||
|
||||
proto_obj_p = ecma_builtin_get (default_proto_id);
|
||||
ecma_ref_object (proto_obj_p);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user