Make the existence test depend on the nodelist, not on node values - #117
Merged
Merged
Conversation
besok
approved these changes
Sep 9, 2026
Owner
|
thank you for the pr. i missed this part apparently in the spec. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #91. This covers part of it, see the note at the end.
RFC 9535 section 2.3.5.2 makes a test expression true when the nodelist it
produces is non-empty. The value of the nodes does not take part in it.
src/query/atom.rslooked inside the value instead:So
$[?@.x]dropped objects whosexis an empty array, an empty object or anempty string, while keeping
null,0andfalse:There was a second point in the same expression:
Data::Refs(elems) => elems .iter().map(|v| v.inner).all(struct_check)usedall, so a single empty nodemade the whole test false even when the nodelist had several members.
Both are replaced by a nodelist-emptiness check.
What this does not fix
filter, nestedstays red, so I have not marked this as closing #91. Theremaining problem looks separate, and specific to a filter selector applied
directly to
@:I have not looked into that one yet.
One question: was
struct_checkthere for a reason I am not seeing? Every unittest and the compliance suite pass without it, but you would know better whether
something depends on the old behaviour.