Implement the core of Proxy object (#3562)

- Internal routines of the of the proxy object are unimplemented
 - For-in enumerate with proxy target is currently not supported

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
Robert Fancsik
2020-02-28 14:41:59 +01:00
committed by GitHub
parent 9b393ee2ea
commit 4e136c8973
57 changed files with 3017 additions and 397 deletions
@@ -22,6 +22,7 @@
#include "ecma-helpers.h"
#include "ecma-objects.h"
#include "ecma-objects-general.h"
#include "ecma-proxy-object.h"
#include "ecma-try-catch-macro.h"
/** \addtogroup ecma ECMA
@@ -362,6 +363,13 @@ ecma_op_general_object_define_own_property (ecma_object_t *object_p, /**< the ob
const ecma_property_descriptor_t *property_desc_p) /**< property
* descriptor */
{
#if ENABLED (JERRY_ES2015_BUILTIN_PROXY)
if (ECMA_OBJECT_IS_PROXY (object_p))
{
return ecma_proxy_object_define_own_property (object_p, property_name_p, property_desc_p);
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_PROXY) */
JERRY_ASSERT (object_p != NULL
&& !ecma_is_lexical_environment (object_p));
JERRY_ASSERT (!ecma_op_object_is_fast_array (object_p));
@@ -403,7 +411,7 @@ ecma_op_general_object_define_own_property (ecma_object_t *object_p, /**< the ob
if (current_prop == ECMA_PROPERTY_TYPE_NOT_FOUND || current_prop == ECMA_PROPERTY_TYPE_NOT_FOUND_AND_STOP)
{
/* 3. */
if (!ecma_get_object_extensible (object_p))
if (!ecma_op_ordinary_object_is_extensible (object_p))
{
/* 2. */
return ecma_reject (property_desc_p->flags & ECMA_PROP_IS_THROW);