Skip to content

Commit b75728c

Browse files
michaelcpuckettdavidlehn
authored andcommitted
Fix for: Framing does not respect specified value #300
1 parent 84b7768 commit b75728c

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

lib/frame.js

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)