Remove deprecated native handle support. (#2496)

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2018-08-29 12:51:37 +02:00
committed by GitHub
parent b4dc6b0cbe
commit 7d41d38e3c
9 changed files with 32 additions and 295 deletions
@@ -25,27 +25,17 @@
*/
/**
* Create internal property with specified identifier and store native handle/pointer of the object.
*
* Note:
* property identifier should be one of the following:
* - LIT_INTERNAL_MAGIC_STRING_NATIVE_HANDLE
* - LIT_INTERNAL_MAGIC_STRING_NATIVE_POINTER
* Create a native pointer property to store the native pointer and its type info.
*
* @return true - if property was just created with specified value,
* false - otherwise, if property existed before the call, it's value was updated
*/
static bool
ecma_create_native_property (ecma_object_t *obj_p, /**< object to create property in */
lit_magic_string_id_t id, /**< identifier of internal
* property to create */
void *data_p, /**< native pointer data */
void *info_p) /**< native pointer's info */
bool
ecma_create_native_pointer_property (ecma_object_t *obj_p, /**< object to create property in */
void *native_p, /**< native pointer */
void *info_p) /**< native pointer's type info */
{
JERRY_ASSERT (id == LIT_INTERNAL_MAGIC_STRING_NATIVE_HANDLE
|| id == LIT_INTERNAL_MAGIC_STRING_NATIVE_POINTER);
ecma_string_t *name_p = ecma_get_magic_string (id);
ecma_string_t *name_p = ecma_get_magic_string (LIT_INTERNAL_MAGIC_STRING_NATIVE_POINTER);
ecma_property_t *property_p = ecma_find_named_property (obj_p, name_p);
bool is_new = (property_p == NULL);
@@ -68,44 +58,10 @@ ecma_create_native_property (ecma_object_t *obj_p, /**< object to create propert
native_pointer_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_native_pointer_t, value_p->value);
}
native_pointer_p->data_p = data_p;
native_pointer_p->u.info_p = info_p;
native_pointer_p->data_p = native_p;
native_pointer_p->info_p = info_p;
return is_new;
} /* ecma_create_native_property */
/**
* Create a native handle property to store the native handle and its free callback.
*
* @return true - if property was just created with specified value,
* false - otherwise, if property existed before the call, it's value was updated
*/
bool
ecma_create_native_handle_property (ecma_object_t *obj_p, /**< object to create property in */
void *handle_p, /**< native handle */
void *free_cb) /**< native handle's free callback*/
{
return ecma_create_native_property (obj_p,
LIT_INTERNAL_MAGIC_STRING_NATIVE_HANDLE,
handle_p,
free_cb);
} /* ecma_create_native_handle_property */
/**
* Create a native pointer property to store the native pointer and its type info.
*
* @return true - if property was just created with specified value,
* false - otherwise, if property existed before the call, it's value was updated
*/
bool
ecma_create_native_pointer_property (ecma_object_t *obj_p, /**< object to create property in */
void *native_p, /**< native pointer */
void *info_p) /**< native pointer's type info */
{
return ecma_create_native_property (obj_p,
LIT_INTERNAL_MAGIC_STRING_NATIVE_POINTER,
native_p,
info_p);
} /* ecma_create_native_pointer_property */
/**
@@ -120,14 +76,10 @@ ecma_create_native_pointer_property (ecma_object_t *obj_p, /**< object to create
* NULL otherwise
*/
ecma_native_pointer_t *
ecma_get_native_pointer_value (ecma_object_t *obj_p, /**< object to get property value from */
lit_magic_string_id_t id) /**< identifier of internal property
* to get value from */
ecma_get_native_pointer_value (ecma_object_t *obj_p) /**< object to get property value from */
{
JERRY_ASSERT (id == LIT_INTERNAL_MAGIC_STRING_NATIVE_HANDLE
|| id == LIT_INTERNAL_MAGIC_STRING_NATIVE_POINTER);
ecma_property_t *property_p = ecma_find_named_property (obj_p, ecma_get_magic_string (id));
ecma_string_t *name_p = ecma_get_magic_string (LIT_INTERNAL_MAGIC_STRING_NATIVE_POINTER);
ecma_property_t *property_p = ecma_find_named_property (obj_p, name_p);
if (property_p == NULL)
{