fix property type checking

This commit is contained in:
blagoev 2017-08-17 12:37:29 +03:00 committed by Thomas Goyne
parent f115a641b0
commit 1e5c8b95e1
1 changed files with 9 additions and 5 deletions

View File

@ -397,6 +397,15 @@ inline bool Value<T>::is_valid_for_property(ContextType context, const ValueType
inline std::string js_type_name_for_property_type(PropertyType type)
{
if (realm::is_array(type)) {
if (type == PropertyType::LinkingObjects) {
throw std::runtime_error("LinkingObjects' type is not supported");
}
else if (type == PropertyType::Array) {
return "array";
}
}
switch (type) {
case PropertyType::Int:
case PropertyType::Float:
@ -412,13 +421,8 @@ inline std::string js_type_name_for_property_type(PropertyType type)
return "binary";
case PropertyType::Object:
return "object";
case PropertyType::Array:
return "array";
case PropertyType::Any:
throw std::runtime_error("'Any' type is not supported");
case PropertyType::LinkingObjects:
throw std::runtime_error("LinkingObjects' type is not supported");
}
REALM_UNREACHABLE();