improve properties declaration (#3842)

* improve properties declaration

* cherry pick: CCClass: allow array type working togather with getter (#3545)

Commit:
37f4f06419a7b6a68283a4d1e46ff937bdccb941 [37f4f064]
This commit is contained in:
Jare Guo
2019-02-14 15:31:21 +08:00
committed by pandamicro
parent 64ce38e24d
commit ef77d2b342
2 changed files with 2 additions and 4 deletions
@@ -18,7 +18,6 @@ export class RenderableComponent extends Component {
}
@property({
default: [],
type: Material,
displayName: 'Materials',
})
+2 -3
View File
@@ -136,9 +136,8 @@ function checkUrl (val, className, propName, url) {
function parseType (val, type, className, propName) {
if (Array.isArray(type)) {
if (CC_EDITOR) {
var isArray = cc.Class.isArray; // require lazily to avoid circular require() calls
if (!isArray(val.default)) {
if (CC_EDITOR && 'default' in val) {
if (!cc.Class.isArray(val.default)) {
cc.warnID(5507, className, propName);
}
}