Clean up property existence check inconsistencies (#1860)
`jerry_has_property ()` and `jerry_has_own_property ()` are inconsistent in that they squash their return value into a `bool` when in fact it is a `jerry_value_t`, thereby giving the wrong impression that a property is there when it isn't and encouraging the leaking of `jerry_value_t`s by disguising them as `bool`s. Fixes https://github.com/jerryscript-project/jerryscript/issues/1859 JerryScript-DCO-1.0-Signed-off-by: Gabriel Schulhof gabriel.schulhof@intel.com
This commit is contained in:
committed by
László Langó
parent
b51b6824bb
commit
708b155f38
@@ -1424,7 +1424,7 @@ jerry_substring_to_utf8_char_buffer (const jerry_value_t value, /**< input strin
|
||||
* @return true - if the property exists
|
||||
* false - otherwise
|
||||
*/
|
||||
bool
|
||||
jerry_value_t
|
||||
jerry_has_property (const jerry_value_t obj_val, /**< object value */
|
||||
const jerry_value_t prop_name_val) /**< property name (string value) */
|
||||
{
|
||||
@@ -1448,7 +1448,7 @@ jerry_has_property (const jerry_value_t obj_val, /**< object value */
|
||||
* @return true - if the property exists
|
||||
* false - otherwise
|
||||
*/
|
||||
bool
|
||||
jerry_value_t
|
||||
jerry_has_own_property (const jerry_value_t obj_val, /**< object value */
|
||||
const jerry_value_t prop_name_val) /**< property name (string value) */
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user