@@ -61,6 +61,41 @@ Logic.prototype.process = function (data) {
61
61
62
62
} ;
63
63
64
+ /**
65
+ * This method inherits all property properties from inherited classes.
66
+ * @param {string } className
67
+ * @param {string } propertyName
68
+ * @returns {boolean } - if property name was taken (exists in inherited classes)
69
+ */
70
+ Logic . prototype . takePropertyFromSuper = function ( className , propertyName ) {
71
+
72
+ var self = this , cls ,
73
+ newProperty ;
74
+
75
+ if ( ! this . data || ! this . data . classes || ! ( cls = this . data . classes [ className ] ) ) return false ;
76
+
77
+ function getP ( cls ) {
78
+ var sups , prop = { } , p ;
79
+ cls = cls || { } ;
80
+ sups = ( cls . Super || "" ) . split ( "," ) ;
81
+ if ( cls . Inheritance === "right" ) sups . reverse ( ) ;
82
+ sups . forEach ( function ( sup ) {
83
+ if ( ! ( p = self . data . classes [ sup ] ) ) return ;
84
+ prop = lib . extend ( prop , getP ( p ) ) ;
85
+ } ) ;
86
+ if ( cls . properties && ( p = cls . properties [ propertyName ] ) ) {
87
+ prop = lib . extend ( prop , p ) ;
88
+ }
89
+ return prop ;
90
+ }
91
+
92
+ if ( ! lib . isEmptyObject ( newProperty = getP ( cls ) ) ) {
93
+ cls . properties [ propertyName ] = newProperty ;
94
+ return true ;
95
+ } else return false ;
96
+
97
+ } ;
98
+
64
99
Logic . prototype . fillIndices = function ( ) {
65
100
66
101
var className , cls , indexName , j , index , props , propName ;
@@ -69,9 +104,10 @@ Logic.prototype.fillIndices = function () {
69
104
cls = this . data . classes [ className ] ;
70
105
for ( indexName in cls . indices ) {
71
106
index = cls . indices [ indexName ] ;
72
- props = index [ "Properties" ] . split ( "," ) ;
107
+ props = ( index [ "Properties" ] || "?" ) . split ( "," ) ;
73
108
for ( j in props ) {
74
- if ( cls . properties [ propName = props [ j ] . match ( / [ ^ \( ] + / ) [ 0 ] ] ) {
109
+ if ( cls . properties [ propName = props [ j ] . match ( / [ ^ \( ] + / ) [ 0 ] ]
110
+ || this . takePropertyFromSuper ( className , propName ) ) {
75
111
cls . properties [ propName ] . index = index ;
76
112
} else {
77
113
console . warn (
0 commit comments