Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid flags supplied to RegExp constructor 'y' #372

Closed
fernandogmar opened this issue Jan 24, 2018 · 1 comment
Closed

Invalid flags supplied to RegExp constructor 'y' #372

fernandogmar opened this issue Jan 24, 2018 · 1 comment

Comments

@fernandogmar
Copy link

fernandogmar commented Jan 24, 2018

Hi Denis,

I expected that the RegExp polyfill would work with the sticky flag 'y'
var identifierRe = new RegExp('[a-zA-Z_][a-zA-Z0-9_-]*', 'y');

but in safari v9.1 it fails with error:
Invalid flags supplied to RegExp constructor

Am I doing something wrong? or doesn't this polyfill support the sticky flag at all?

Thanks in advance!

@zloirock
Copy link
Owner

Hi. The sticky flag support is not polyfilled in core-js. After this discussion I spent some time playing with the sticky flag but I didn't add it IIRC because of problems with some early implementations. At this moment, adding support for the sticky flag is not in my plans. Feel free to add a PR.

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

Successfully merging a pull request may close this issue.

2 participants