Primitive value should't be wrapped in an array#326
Open
tompng wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adjusts XPath evaluation return values and XPath function outputs for variable resolution and node naming/namespace helpers.
Changes:
- Changes variable expression evaluation to return the variable value directly (instead of wrapping in an Array).
- Updates
namespace_uriandnameXPath functions to early-return values from withinget_namespaceblocks and adds""fallbacks.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| lib/rexml/xpath_parser.rb | Changes the return type of variable expression evaluation. |
| lib/rexml/functions.rb | Reworks namespace_uri/name to return directly from block and adds empty-string fallbacks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| when :variable | ||
| var_name = path_stack.shift | ||
| return [@variables[var_name]] | ||
| return @variables[var_name] |
Comment on lines
+77
to
+80
| get_namespace( node_set ) do |node| | ||
| return node.namespace | ||
| end | ||
| "" |
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.
Similar to #324
Values should be nodeset(Array) or primitive, not
[primitive]It works even wrapping with an array, but leaving it will be a blocker of implementing delayed nodeset ordering.