Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upPrevent infinite loop from empty match (fix #77) #156
Conversation
jonathanhefner
added some commits
Feb 2, 2015
pushed a commit
that referenced
this pull request
Feb 2, 2015
evancz
merged commit fe85d07
into
elm:master
Feb 2, 2015
1 check passed
continuous-integration/travis-ci
The Travis CI build passed
Details
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
jonathanhefner commentedFeb 2, 2015
This fix for #77 prevents empty regex matches (via e.g.
/a?/,/a*/) from causing an infinite loop. It does so by checking that the regex'slastIndexproperty increases on each call toRegExp.exec.Incidentally,
RegExp.execsucks and mutation is evil, so I included another fix to prevent said mutation from leaking into Elm.Test coverage is included.