@@ -597,19 +597,8 @@ function _filterSubject(state, subject, frame, flags) {
597597 return false ;
598598 }
599599 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 ;
604600 } 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 ) ) {
613602 const listValue = thisFrame [ '@list' ] [ 0 ] ;
614603 if ( graphTypes . isList ( nodeValues [ 0 ] ) ) {
615604 const nodeListValues = nodeValues [ 0 ] [ '@list' ] ;
@@ -622,10 +611,16 @@ function _filterSubject(state, subject, frame, flags) {
622611 matchThis = nodeListValues . some ( lv => _nodeMatch (
623612 state , listValue , lv , flags ) ) ;
624613 }
625- } else {
626- // value must be a list to match
627- matchThis = false ;
628614 }
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 ;
629624 }
630625 }
631626 }
0 commit comments