You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reset Regex state after calling 'test', resolves#7
Previously, the second `assert` in the following code would fail:
``` purs
let pattern = regex "a" (parseFlags "g")
assert $ test pattern "a"
assert $ test pattern "a"
```
because the RegExp object in JavaScript maintains a global state
(for details, see the discussion in #7).
This commit resets the `lastIndex` property on the RegExp object,
such that both calls to `test` return the same result.
0 commit comments