*refactored to return unknown when trying to access a not exist key in a dictionary.
This commit is contained in:
parent
3400ec68c2
commit
5c668fa432
1
HISTORY
1
HISTORY
@ -1,4 +1,5 @@
|
|||||||
Aug. 6 2016
|
Aug. 6 2016
|
||||||
|
Refactored to return UNKNOWN when trying to access a not exist key in a dictionary
|
||||||
Added reflection accessing ability to the SET statement
|
Added reflection accessing ability to the SET statement
|
||||||
|
|
||||||
Aug. 4 2016
|
Aug. 4 2016
|
||||||
|
@ -7245,8 +7245,16 @@ static bool_t _find_dict(_dict_t* coll, mb_value_t* val, mb_value_t* oval) {
|
|||||||
_create_internal_object_from_public_value(val, &oarg);
|
_create_internal_object_from_public_value(val, &oarg);
|
||||||
result = _ht_find(coll->dict, oarg);
|
result = _ht_find(coll->dict, oarg);
|
||||||
_destroy_object(oarg, 0);
|
_destroy_object(oarg, 0);
|
||||||
if(oval && result && result->data)
|
if(oval) {
|
||||||
|
if(result && result->data) {
|
||||||
_internal_object_to_public_value((_object_t*)result->data, oval);
|
_internal_object_to_public_value((_object_t*)result->data, oval);
|
||||||
|
} else {
|
||||||
|
oval->type = MB_DT_UNKNOWN;
|
||||||
|
oval->value.integer = 0;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return !!(result && result->data);
|
return !!(result && result->data);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user