Skip to content
This repository was archived by the owner on Apr 14, 2021. It is now read-only.

Allow disable of RegExp cache/restore #197

Closed

Conversation

mtlewis
Copy link
Contributor

@mtlewis mtlewis commented Jun 30, 2016

Fixes #196.

The implementation of cache/restore of RegExp properties
has the potential to cause a number of issues. A perfect
solution is not possible because it's not possible to
determine the regex that was used to turn the cached input
into the cached match and group matches. The current
solution simply takes the lastMatch and escapes it,
wrapping any match groups in parens. One problem with
this approach is that when the match is very long, it
will overrun the maximum length of a RegEx in JavaScript.

In this commit, we add the capability to disable restore
of RegExp properties entirely, via
IntlPolyfill.__disableRegExpRestore.

The implementation of cache/restore of RegExp properties
has the potential to cause a number of issues.  A perfect
solution is not possible because it's not possible to
determine the regex that was used to turn the cached input
into the cached match and group matches.  The current
solution simply takes the lastMatch and escapes it,
wrapping any match groups in parens.  One problem with
this approach is that when the match is very long, it
will overrun the maximum length of a RegEx in JavaScript.

In this commit, we add the capability to disable restore
of RegExp properties entirely, via
`IntlPolyfill.__disableRegExpRestore`.
@mtlewis
Copy link
Contributor Author

mtlewis commented Jul 5, 2016

Closing in favour of #201.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant