mirror of
https://github.com/status-im/realm-js.git
synced 2025-01-09 22:05:57 +00:00
fix property type checking
This commit is contained in:
parent
640079f50a
commit
ea0d92c205
@ -396,6 +396,15 @@ inline bool Value<T>::is_valid_for_property(ContextType context, const ValueType
|
|||||||
|
|
||||||
inline std::string js_type_name_for_property_type(PropertyType type)
|
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) {
|
switch (type) {
|
||||||
case PropertyType::Int:
|
case PropertyType::Int:
|
||||||
case PropertyType::Float:
|
case PropertyType::Float:
|
||||||
@ -411,13 +420,8 @@ inline std::string js_type_name_for_property_type(PropertyType type)
|
|||||||
return "binary";
|
return "binary";
|
||||||
case PropertyType::Object:
|
case PropertyType::Object:
|
||||||
return "object";
|
return "object";
|
||||||
case PropertyType::Array:
|
|
||||||
return "array";
|
|
||||||
|
|
||||||
case PropertyType::Any:
|
case PropertyType::Any:
|
||||||
throw std::runtime_error("'Any' type is not supported");
|
throw std::runtime_error("'Any' type is not supported");
|
||||||
case PropertyType::LinkingObjects:
|
|
||||||
throw std::runtime_error("LinkingObjects' type is not supported");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
REALM_UNREACHABLE();
|
REALM_UNREACHABLE();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user