@@ -61,6 +61,41 @@ Logic.prototype.process = function (data) {
6161
6262} ;
6363
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+
6499Logic . prototype . fillIndices = function ( ) {
65100
66101 var className , cls , indexName , j , index , props , propName ;
@@ -69,9 +104,10 @@ Logic.prototype.fillIndices = function () {
69104 cls = this . data . classes [ className ] ;
70105 for ( indexName in cls . indices ) {
71106 index = cls . indices [ indexName ] ;
72- props = index [ "Properties" ] . split ( "," ) ;
107+ props = ( index [ "Properties" ] || "?" ) . split ( "," ) ;
73108 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 ) ) {
75111 cls . properties [ propName ] . index = index ;
76112 } else {
77113 console . warn (
0 commit comments