Commit 9b9aeae
fix(core): use matchAll instead of exec in findUsedTokenNames (#333)
* fix(core): use `String.prototype.matchAll` instead of `RegExp.prototype.exec` in `findUsedTokenNames`
Replace `RegExp.prototype.exec` with `String.prototype.matchAll` to avoid
potential issues with shared `lastIndex` state on the module-scoped
`TOKEN_CONSUMER_PATTERN` regex. `matchAll` internally copies the regex,
making the function robust against future changes that might interrupt the
loop early.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore: add changeset for findUsedTokenNames fix
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent c4b6e2e commit 9b9aeae
2 files changed
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
| 46 | + | |
48 | 47 | | |
49 | 48 | | |
50 | 49 | | |
| |||
0 commit comments