xregexp
xregexp copied to clipboard
Also update .lastIndex on natively sticky regexps
As mentioned in https://github.com/slevithan/xregexp/pull/154#issuecomment-280164443 regexps that have both the global and sticky flag ignore the former and do sticky matches. So there's nothing special to add to their handling AFAICT.
Wait, there's more... I haven't updated fixed.exec (and I wonder how the tests actually pass).
Looking deeper into this, I should also probably revise XRegexp.match and possibly other methods. It's late though, and I'm starting to get hazy. I'll ping you when it is ready.
Hey, no rush! And thanks. :D
In case it's helpful, http://2ality.com/2015/07/regexp-es6.html describes the rules for lastIndex with /y in detail.