Closed odanado closed 5 months ago
Sorry @odanado, I was a bit fast. exec()
won't work, so I changed it to this implementation using match()
instead (which should also have good performance):
https://github.com/capricorn86/happy-dom/pull/1312
Not sure why the unit tests passed in the PR :thinking:
Fix: https://github.com/capricorn86/happy-dom/issues/1308
The previous code was incorrect in its use of RegExp.prototype.exec, and the regular expression matching was performed only once.
RegExp.prototype.exec
is difficult to use correctly because it is a stateful API. I modified the logic using String.prototype.matchAll as described in MDN.