Closed tjenkinson closed 2 years ago
/x{9999999999999999999}/
also throws in Firefox.
doesn't for me?
Ugh, I tested with /x{9999999999999999999}/.test("x".repeat(9999999999999999999))
and the error is from .repeat
, sorry :see_no_evil:
Nice catch, thanks for your contribution. I will wait for #117 to land before drafting a new release.
Currently it's possible to get the wrong result if the number of iterations is outside the JS safe range. This makes it bail instead.
An other approach could be adding string versions of the min and max
minString
/maxString
(?) and allowingmin
andmax
to benull
when outside the range JS can represent? This feels better in that it doesn't cause an error on regex that would be valid but that JS can't represent.Not sure if this should be considered a breaking change. Depends if getting a number close the actual number, but wrong, should be classed as a bug or not 🤷