Skip to content

Commit 96b710f

Browse files
committed
fix issue with collection
1 parent 564ed62 commit 96b710f

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

src/component.js

+14-12
Original file line numberDiff line numberDiff line change
@@ -905,17 +905,19 @@ function addProperties(model, Class, classId) {
905905
function _isValidCollection(coll, type) {
906906
var result = true;
907907

908-
coll.forEach(function(val) {
909-
if (
910-
!(
911-
$metamodel.isValidType(val, type) &&
912-
$metamodel.inheritFrom(val.constructor.name, type) &&
913-
$metamodel.isClassName(type)
914-
)
915-
) {
916-
result = result && false;
917-
}
918-
});
908+
if (type !== 'any') {
909+
coll.forEach(function(val) {
910+
if ($metamodel.isClassName(type)) {
911+
if (!$metamodel.isValidType(val, type) && !$metamodel.inheritFrom(val.constructor.name, type)) {
912+
result = result && false;
913+
}
914+
} else {
915+
if (!$metamodel.isValidType(val, type)) {
916+
result = result && false;
917+
}
918+
}
919+
});
920+
}
919921

920922
return result;
921923
}
@@ -1026,7 +1028,7 @@ function addProperties(model, Class, classId) {
10261028
this.constructor.name,
10271029
propertyName,
10281030
position,
1029-
propertyType[0]
1031+
propertyType === 'array' ? 'any' : propertyType[0]
10301032
);
10311033
}
10321034
} else {

0 commit comments

Comments
 (0)