Allow out_native_pointer_p in jerry_get_object_native_pointer to be NULL (#1876)

Support those cases when the existence of the native property is checked.

JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
This commit is contained in:
Zidong Jiang
2017-06-05 03:44:56 -05:00
committed by Zoltan Herczeg
parent 13930a1cd4
commit 11d5402c35
2 changed files with 8 additions and 2 deletions
+3
View File
@@ -3629,6 +3629,9 @@ The pointer and the type information are previously associated with the object b
`out_native_pointer_p` is of the expected type, before casting
and dereferencing `out_native_pointer_p`.
*Note*: `out_native_pointer_p` and `out_native_info_p` can be NULL, and it means the
caller doesn't want to get the native_pointer or type infomation.
**Prototype**
```c
+5 -2
View File
@@ -2100,9 +2100,12 @@ jerry_get_object_native_pointer (const jerry_value_t obj_val, /**< object to get
return false;
}
*out_native_pointer_p = native_pointer_p->data_p;
if (out_native_pointer_p != NULL)
{
*out_native_pointer_p = native_pointer_p->data_p;
}
if (out_native_info_p)
if (out_native_info_p != NULL)
{
*out_native_info_p = (const jerry_object_native_info_t *) native_pointer_p->u.info_p;
}