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:
committed by
Zoltan Herczeg
parent
13930a1cd4
commit
11d5402c35
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user