diff options
author | inoas <mail@inoas.com> | 2023-05-29 12:34:28 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-29 13:34:28 +0100 |
commit | f8945cba4b9ed2d5490cdf13be1c441fcf81d33f (patch) | |
tree | c1ebe5990396082d6f4621fb2e5a5c78080a7540 /src/gleam_stdlib.mjs | |
parent | 940401f74cd2a35f7639ad8116a91d8af06925c0 (diff) | |
download | gleam_stdlib-f8945cba4b9ed2d5490cdf13be1c441fcf81d33f.tar.gz gleam_stdlib-f8945cba4b9ed2d5490cdf13be1c441fcf81d33f.zip |
Fix repeated `regex.check()` calls on the same regex on target javascript (#459)
Diffstat (limited to 'src/gleam_stdlib.mjs')
-rw-r--r-- | src/gleam_stdlib.mjs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gleam_stdlib.mjs b/src/gleam_stdlib.mjs index 7c41cdd..1163c6f 100644 --- a/src/gleam_stdlib.mjs +++ b/src/gleam_stdlib.mjs @@ -371,6 +371,7 @@ export function utf_codepoint_to_int(utf_codepoint) { } export function regex_check(regex, string) { + regex.lastIndex = 0; return regex.test(string); } |