semver: collapse a || union containing a match-all branch to * before the prerelease rule - #33739
Open
robobun wants to merge 12 commits into
Open
semver: collapse a || union containing a match-all branch to * before the prerelease rule#33739robobun wants to merge 12 commits into
robobun wants to merge 12 commits into
Claude / Claude Code Review
completed
Jul 8, 2026 in 32m 8s
Code review found 3 potential issues
Found 1 candidates, confirmed 3. See review comments for details.
Details
| Severity | Count |
|---|---|
| 🔴 Important | 0 |
| 🟡 Nit | 3 |
| 🟣 Pre-existing | 0 |
| Severity | File:Line | Issue |
|---|---|---|
| 🟡 Nit | src/semver/SemverQuery.rs:943-947 |
Lone '|' (single pipe) misclassified as '||' separator, sets MATCH_ALL_BRANCH |
Annotations
Check warning on line 947 in src/semver/SemverQuery.rs
claude / Claude Code Review
Lone '|' (single pipe) misclassified as '||' separator, sets MATCH_ALL_BRANCH
Same class as the `boop`/`^`/`-` siblings, but at the separator itself: the `b'|'` arm doesn't distinguish a lone `|` from `||` (the inner `while input[i] == b'|'` runs zero times), so `"| 1.2.3-alpha.1"` sets `MATCH_ALL_BRANCH` at line 944 and `Bun.semver.satisfies("1.2.3-alpha.1", "| 1.2.3-alpha.1")` now returns `false` — pre-PR Bun and npm-loose (which only splits on `/\s*\|\|\s*/` and drops a lone `|` via `COMPARATORLOOSE`) return `true`. Trailing form `"1.2.3-alpha.1 |"` hits the same via t
Loading