RegExp test return wrong result when used multiple times

RESOLVED INVALID

Status

()

Firefox
Untriaged
RESOLVED INVALID
6 years ago
6 years ago

People

(Reporter: Sereinity, Unassigned)

Tracking

13 Branch
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

6 years ago
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
(Reporter)

Comment 1

6 years ago
Looks like #98409 came back.

Comment 2

6 years ago
IE9 displays the same behavior.

Comment 3

6 years ago
I think this is duplication of Bug 628254

Comment 4

6 years ago
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
Last Resolved: 6 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.