Skip to content

Primitive value should't be wrapped in an array#326

Open
tompng wants to merge 1 commit into
ruby:masterfrom
tompng:primitive_array_bugfix
Open

Primitive value should't be wrapped in an array#326
tompng wants to merge 1 commit into
ruby:masterfrom
tompng:primitive_array_bugfix

Conversation

@tompng
Copy link
Copy Markdown
Member

@tompng tompng commented Jun 5, 2026

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.

Copilot AI review requested due to automatic review settings June 5, 2026 17:03
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_uri and name XPath functions to early-return values from within get_namespace blocks 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.

Comment thread lib/rexml/xpath_parser.rb
when :variable
var_name = path_stack.shift
return [@variables[var_name]]
return @variables[var_name]
Comment thread lib/rexml/functions.rb
Comment on lines +77 to +80
get_namespace( node_set ) do |node|
return node.namespace
end
""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants