Repository navigation
Conversation
local-name(1), sum("string"), and count(1 < 2) were accepted
or failed with NoMethodError. A predicate or step after a
string, number, or boolean was ignored or matched nothing.
count(), sum(), local-name(), name(), and namespace-uri() coerced the wrong type or called a method on it. A predicate or step after a non-node-set became an empty node-set, so the expression looked like it matched nothing. Those cases now raise TypeError. A real node-set, including id(), is unchanged. Fixes ruby#350
This branch has not been deployed
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.
Fixes #350.
XPath requires a node-set for
count(),sum(),local-name(),name(), andnamespace-uri(), and for a predicate or step after a value. REXML accepted the other types.local-name(1)returned"",sum("string")returnedNaN, andcount(1 < 2)raisedNoMethodError: undefined method 'size' for true. A step after a non-node-set was dropped or turned into an empty node-set:"string"[1]returned the string, andstring(a/b)/cmatched nothing.Those cases now raise
TypeError. A node-set is unchanged, includingid("a")[1]andid("a")/b, which stay an empty node-set becauseid()returns one.local-name()with no argument still uses the context node, and a variable that holds a node can still be filtered.ruby test/run.rb: 866 tests, 2779 assertions.