Add 'type' argument to set/get native handle API (#1711)

Ecma-object have native handle type inside, and binding code could use
type info to validate native handle's type.

Related issue #1681

JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
This commit is contained in:
Zidong Jiang
2017-04-10 16:51:37 +08:00
committed by GitHub
parent 574dff512e
commit e522e740a7
12 changed files with 486 additions and 141 deletions
+22
View File
@@ -195,6 +195,28 @@ typedef int32_t ecma_integer_value_t;
*/
typedef uintptr_t ecma_external_pointer_t;
/**
* Representation for native handle package.
*
* Note: It is for the deprecated api:
* jerry_get_object_native_handle and jerry_set_object_native_handle
*/
typedef struct
{
ecma_external_pointer_t handle_p; /**< points to the external native object */
ecma_external_pointer_t free_cb; /**< free callback of the native handle */
} ecma_native_handle_package_t;
/**
* Representation of the native pointer package.
*/
typedef struct
{
ecma_external_pointer_t native_p; /**< points to the external native object */
ecma_external_pointer_t info_p; /**< type info of the native pointer */
} ecma_native_pointer_package_t;
/**
* Special property identifiers.
*/