@@ -597,19 +597,8 @@ function _filterSubject(state, subject, frame, flags) {
597
597
return false ;
598
598
}
599
599
matchThis = true ;
600
- } else if ( types . isObject ( thisFrame ) ) { // XXX only framing keywords
601
- // node matches if values is not empty and the value of property in
602
- // frame is wildcard
603
- matchThis = nodeValues . length > 0 ;
604
600
} else {
605
- if ( graphTypes . isValue ( thisFrame ) ) {
606
- // match on any matching value
607
- matchThis = nodeValues . some ( nv => _valueMatch ( thisFrame , nv ) ) ;
608
- } else if ( graphTypes . isSubject ( thisFrame ) ||
609
- graphTypes . isSubjectReference ( thisFrame ) ) {
610
- matchThis =
611
- nodeValues . some ( nv => _nodeMatch ( state , thisFrame , nv , flags ) ) ;
612
- } else if ( graphTypes . isList ( thisFrame ) ) {
601
+ if ( graphTypes . isList ( thisFrame ) ) {
613
602
const listValue = thisFrame [ '@list' ] [ 0 ] ;
614
603
if ( graphTypes . isList ( nodeValues [ 0 ] ) ) {
615
604
const nodeListValues = nodeValues [ 0 ] [ '@list' ] ;
@@ -622,10 +611,16 @@ function _filterSubject(state, subject, frame, flags) {
622
611
matchThis = nodeListValues . some ( lv => _nodeMatch (
623
612
state , listValue , lv , flags ) ) ;
624
613
}
625
- } else {
626
- // value must be a list to match
627
- matchThis = false ;
628
614
}
615
+ } else if ( graphTypes . isValue ( thisFrame ) ) {
616
+ matchThis = nodeValues . some ( nv => _valueMatch ( thisFrame , nv ) ) ;
617
+ } else if ( graphTypes . isSubjectReference ( thisFrame ) ) {
618
+ matchThis =
619
+ nodeValues . some ( nv => _nodeMatch ( state , thisFrame , nv , flags ) ) ;
620
+ } else if ( types . isObject ( thisFrame ) ) {
621
+ matchThis = nodeValues . length > 0 ;
622
+ } else {
623
+ matchThis = false ;
629
624
}
630
625
}
631
626
}
0 commit comments