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

createRegExpRestore fails #32

Closed
thorsent opened this issue Dec 5, 2013 · 1 comment
Closed

createRegExpRestore fails #32

thorsent opened this issue Dec 5, 2013 · 1 comment

Comments

@thorsent
Copy link

thorsent commented Dec 5, 2013

Encountered a situation where RegExp.lastMatch==")" which caused this method to fail due to mismatched parentheses. Easy enough to catch that one case and escape the character but possibly there are other conditions that would cause it to fail so raising it as an issue.

Would be curious to learn the motivation for saving and restoring the RegExp state.

@andyearnshaw
Copy link
Owner

There are a few issues with this part of the polyfill that I'm not particularly fond of (for example, the state isn't restored when a throw statement is reached or an unexpected error occurs). The motivation behind it was 90% passing (a lot of) the intl402 tests, 10% wanting to see how hard it would be to avoid tainting RegExp.

I've been in two minds whether to improve it or remove it for a while. I'm still undecided, but in the meantime I'll try and fix this soon.

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

No branches or pull requests

2 participants