@@ -217,10 +217,15 @@ ObjectFrame.prototype.clear = function () {
217
217
/*
218
218
* Filters the frame and its children
219
219
*/
220
- ObjectFrame . prototype . filter = function ( rules , onmatch ) {
220
+ ObjectFrame . prototype . mfilter = function ( rules , onmatch ) {
221
221
var hits = new FrameRule ( ) . testRules ( rules , this , onmatch ) ;
222
222
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
+ }
224
229
}
225
230
return this ;
226
231
} ;
@@ -420,20 +425,21 @@ ObjectFrame.prototype.removePropertyValue = function (prop, value, index) {
420
425
} ;
421
426
422
427
ObjectFrame . 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
+ }
425
431
426
432
ObjectFrame . prototype . extract = function ( ) {
427
433
var extracts = { } ;
428
434
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 ( ) ;
432
438
if ( ! FrameHelper . empty ( extracted ) ) {
433
439
if ( typeof extracts [ prop ] == "undefined" ) extracts [ prop ] = [ ] ;
434
440
extracts [ prop ] = extracts [ prop ] . concat ( extracted ) ;
435
441
}
436
- }
442
+ // }
437
443
if ( extracts [ prop ] && extracts [ prop ] . length == 1 ) extracts [ prop ] = extracts [ prop ] [ 0 ]
438
444
}
439
445
if ( FrameHelper . empty ( extracts ) && this . parent ) {
@@ -817,10 +823,10 @@ PropertyFrame.prototype.createEmpty = function(){
817
823
}
818
824
}
819
825
820
- PropertyFrame . prototype . filter = function ( rules , onmatch ) {
826
+ PropertyFrame . prototype . mfilter = function ( rules , onmatch ) {
821
827
var hits = new FrameRule ( ) . testRules ( rules , this , onmatch ) ;
822
828
for ( var i = 0 ; i < this . values . length ; i ++ ) {
823
- this . values [ i ] . filter ( rules , onmatch ) ;
829
+ this . values [ i ] . mfilter ( rules , onmatch ) ;
824
830
}
825
831
return this ;
826
832
}
@@ -941,7 +947,7 @@ DataFrame.prototype.copy = function (newid) {
941
947
return copy ;
942
948
} ;
943
949
944
- DataFrame . prototype . filter = function ( rules , onmatch ) {
950
+ DataFrame . prototype . mfilter = function ( rules , onmatch ) {
945
951
var hits = new FrameRule ( ) . testRules ( rules , this , onmatch ) ;
946
952
return this ;
947
953
} ;
@@ -1036,7 +1042,9 @@ ObjectFrame.prototype.getComment = DataFrame.prototype.getComment;
1036
1042
1037
1043
1038
1044
DataFrame . 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} )
1040
1048
return this . err ;
1041
1049
} ;
1042
1050
0 commit comments