FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[fix] MatchData#deconstruct_keys: include non-participating captures by kares · Pull Request #9335 · jruby/jruby · GitHub

/ jruby Public

[fix] MatchData#deconstruct_keys: include non-participating captures - #9335

Merged
headius merged 1 commit into
jruby:jruby-10.0from
kares:deconstruct-keys-10
Mar 28, 2026
Merged

[fix] MatchData#deconstruct_keys: include non-participating captures#9335
headius merged 1 commit into
jruby:jruby-10.0from
kares:deconstruct-keys-10

Conversation

kares commented Mar 28, 2026

Copy link
Copy Markdown
Member

JRuby skipped named capture groups that did not participate in the match (value is nil).

With nil argument, such keys were omitted entirely. With explicit keys, iteration stopped at the first non-participating capture.

CRuby includes non-participating captures with nil values in all cases. This is important for pattern matching where the absence of a key means "does not match" while nil means "matched nothing".

JRuby skipped named capture groups that did not participate
in the match (value is nil).

With nil argument, such keys were omitted entirely.
With explicit keys, iteration stopped at the first non-participating
capture.

CRuby includes non-participating captures with nil values in all
cases. This is important for pattern matching where the absence of
a key means "does not match" while nil means "matched nothing".
kares added this to the JRuby 10.0.5.0 milestone Mar 28, 2026

headius left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Consider moving specs to ruby/spec.

headius merged commit 330e2e0 into jruby:jruby-10.0 Mar 28, 2026
107 checks passed
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL