Commit eada495
fix: reset regex state in hasEditProposals (#7)
The module-level regexes use the /g flag (required by matchAll in
parseEditProposals). However, RegExp.prototype.test() on a global
regex advances lastIndex, so consecutive calls to hasEditProposals
with the same input alternate between true and false.
Reset lastIndex to 0 before each test call. Added a regression test
that verifies consecutive calls return consistent results.
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent f1d174a commit eada495
2 files changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
87 | 94 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
76 | 78 | | |
77 | 79 | | |
0 commit comments