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

deepEqual for RegExp should compare sticky #284

Closed
slevithan opened this issue Jul 17, 2012 · 2 comments
Closed

deepEqual for RegExp should compare sticky #284

slevithan opened this issue Jul 17, 2012 · 2 comments

Comments

@slevithan
Copy link

The current implementation of deepEqual for RegExp objects is good. Specifically, it's great that it doesn't compare lastIndex properties. However, the current implementation ignores the /y flag and its corresponding sticky property, which should be added to the list of comparisons.

Aside: ES6 will add support for two new RegExp flags: /y and /u. The /y flag is already supported in Firefox 3+, and has the corresponding property RegExp.prototype.sticky. The /u flag will likely show up with the property name unicode, but since that's not in writing anywhere, at the moment, it would probably be best to wait until the first implementations for /u show up before comparing unicode properties.

@prathe
Copy link
Contributor

prathe commented Jul 17, 2012

Thanks for bringing this Steven. I will look to add support for the sticky flag.

@vivin
Copy link
Contributor

vivin commented Aug 8, 2012

I have a fix for this, but grunt won't run the tests because "y" is still an invalid flag and hasn't been implemented (I'm assuming in PhantomJS). Is there a way to test it? With just the change, the tests all pass, but that's because none of the RegExp tests are trying to build a regular expression with the sticky flag.

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

No branches or pull requests

4 participants