Closed Bug 770909 Opened 12 years ago Closed 12 years ago

RegExp test return wrong result when used multiple times

Categories

(Firefox :: Untriaged, defect)

13 Branch
x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: sereinity, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1
Build ID: 20120615112143

Steps to reproduce:

in JS console (Firebug and Firefox's) :
reg = new RegExp("A", "g");
reg.test("A");
reg.test("A");


Actual results:

The first test return true, the second false


Expected results:

both tests must return true
Looks like #98409 came back.
IE9 displays the same behavior.
I think this is duplication of Bug 628254
https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/RegExp/test

"As with exec (or in combination with it), test called multiple times on the same global regular expression instance will advance past the previous match."
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.