Fix return value of 'jerry_api_get_object_field_value'
Fixed the return value to return false when the field does not exist as the documentation says. Related issue: #1041 JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
This commit is contained in:
@@ -351,6 +351,11 @@ main (void)
|
||||
JERRY_ASSERT (sz == 0);
|
||||
jerry_api_release_value (&args[0]);
|
||||
|
||||
// Get global.boo (non-existing field)
|
||||
is_ok = jerry_api_get_object_field_value (global_obj_p, (jerry_api_char_t *) "boo", &val_t);
|
||||
JERRY_ASSERT (!is_ok);
|
||||
JERRY_ASSERT (val_t.type == JERRY_API_DATA_TYPE_UNDEFINED);
|
||||
|
||||
// Get global.t
|
||||
is_ok = jerry_api_get_object_field_value (global_obj_p, (jerry_api_char_t *)"t", &val_t);
|
||||
JERRY_ASSERT (is_ok
|
||||
|
||||
Reference in New Issue
Block a user