@@ -217,10 +217,15 @@ ObjectFrame.prototype.clear = function () {
217217/*
218218 * Filters the frame and its children
219219 */
220- ObjectFrame . prototype . filter = function ( rules , onmatch ) {
220+ ObjectFrame . prototype . mfilter = function ( rules , onmatch ) {
221221 var hits = new FrameRule ( ) . testRules ( rules , this , onmatch ) ;
222222 for ( const prop of Object . keys ( this . properties ) ) {
223- this . properties [ prop ] . filter ( rules , onmatch ) ;
223+ if ( ! this . properties [ prop ] . mfilter ) {
224+ console . log ( prop , this . properties [ prop ] )
225+ }
226+ else {
227+ this . properties [ prop ] . mfilter ( rules , onmatch ) ;
228+ }
224229 }
225230 return this ;
226231} ;
@@ -420,20 +425,21 @@ ObjectFrame.prototype.removePropertyValue = function (prop, value, index) {
420425} ;
421426
422427ObjectFrame . prototype . error = function ( msg ) {
423- console . error ( msg ) ;
424- } ;
428+ if ( ! this . errors ) this . errors = [ ]
429+ this . errors . push ( { "type" : "Internal Object Frame Error" , msg} )
430+ }
425431
426432ObjectFrame . prototype . extract = function ( ) {
427433 var extracts = { } ;
428434 for ( var prop in this . properties ) {
429- if ( ! Array . isArray ( this . properties [ prop ] ) ) this . properties [ prop ] = [ this . properties [ prop ] ]
430- for ( var i = 0 ; i < this . properties [ prop ] . length ; i ++ ) {
431- var extracted = this . properties [ prop ] [ i ] . extract ( ) ;
435+ // if(!Array.isArray(this.properties[prop])) this.properties[prop] = [this.properties[prop]]
436+ // for(var i = 0; i<this.properties[prop].length; i++){
437+ var extracted = this . properties [ prop ] . extract ( ) ;
432438 if ( ! FrameHelper . empty ( extracted ) ) {
433439 if ( typeof extracts [ prop ] == "undefined" ) extracts [ prop ] = [ ] ;
434440 extracts [ prop ] = extracts [ prop ] . concat ( extracted ) ;
435441 }
436- }
442+ // }
437443 if ( extracts [ prop ] && extracts [ prop ] . length == 1 ) extracts [ prop ] = extracts [ prop ] [ 0 ]
438444 }
439445 if ( FrameHelper . empty ( extracts ) && this . parent ) {
@@ -817,10 +823,10 @@ PropertyFrame.prototype.createEmpty = function(){
817823 }
818824}
819825
820- PropertyFrame . prototype . filter = function ( rules , onmatch ) {
826+ PropertyFrame . prototype . mfilter = function ( rules , onmatch ) {
821827 var hits = new FrameRule ( ) . testRules ( rules , this , onmatch ) ;
822828 for ( var i = 0 ; i < this . values . length ; i ++ ) {
823- this . values [ i ] . filter ( rules , onmatch ) ;
829+ this . values [ i ] . mfilter ( rules , onmatch ) ;
824830 }
825831 return this ;
826832}
@@ -941,7 +947,7 @@ DataFrame.prototype.copy = function (newid) {
941947 return copy ;
942948} ;
943949
944- DataFrame . prototype . filter = function ( rules , onmatch ) {
950+ DataFrame . prototype . mfilter = function ( rules , onmatch ) {
945951 var hits = new FrameRule ( ) . testRules ( rules , this , onmatch ) ;
946952 return this ;
947953} ;
@@ -1036,7 +1042,9 @@ ObjectFrame.prototype.getComment = DataFrame.prototype.getComment;
10361042
10371043
10381044DataFrame . prototype . error = function ( msg ) {
1039- if ( msg ) this . err = msg ;
1045+ if ( msg ) this . err = msg ;
1046+ if ( ! this . errors ) this . errors = [ ]
1047+ this . errors . push ( { "type" : "Internal Data Frame Error" , msg} )
10401048 return this . err ;
10411049} ;
10421050
0 commit comments