[Webkit-unassigned] [Bug 103822] RegExp.prototype.exec should always update lastIndex if no match was found

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Dec 1 17:10:33 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=103822





--- Comment #1 from André Bargull <andre.bargull at gmail.com>  2012-12-01 17:12:54 PST ---
RegExp.prototype.test, String.prototype.match and String.prototype.replace are also affected.
List of different javascript engines/browsers and the result for each test:
---
r = /a/; r.lastIndex = 1; r.exec("zzzz"); r.lastIndex
Bad: JSC, V8, SM
Good: Opera, IE

r = /a/; r.lastIndex = 1; r.test("zzzz"); r.lastIndex
Bad: JSC, V8, SM, Opera
Good: IE

r = /a/; r.lastIndex = 1; "zzzz".match(r); r.lastIndex
Bad: JSC, V8, SM
Good: Opera, IE

r = /a/; r.lastIndex = 1; "zzzz".replace(r, ""); r.lastIndex
Bad: JSC, V8, SM, Opera
Good: IE
---

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list