Closed Bug 256798 Opened 20 years ago Closed 20 years ago

JS regexp zero-width positive lookahead broken by bug 254296's patch

Categories

(Core :: JavaScript Engine, defect, P1)

defect

Tracking

()

VERIFIED FIXED
mozilla1.8alpha4

People

(Reporter: brendan, Assigned: brendan)

References

()

Details

(4 keywords)

Attachments

(2 files)

The patch for bug 254296 regressed zero-width positive lookehead assertions:

js> /(?:(a)+)/("baaaa")
aaaa,a
js> /(?=(a+))/("baaabac")
,aaa
js> /b(?=(a+))/("baaabac")
b,aaa
js> /b(?=(b+))/("baaabac")
null

The last case should return ["b", "b"].

Must-fix for branches and trunk.

/be
Status: NEW → ASSIGNED
Flags: blocking1.8a4+
Flags: blocking1.7.3+
Flags: blocking-aviary1.0PR+
Priority: -- → P1
Target Milestone: --- → mozilla1.8alpha4
Attached patch fixSplinter Review
for a(?=b), we want to fail fast if SimpleMatch fails, whether or not it
consumed the entire zero-width assertion.  Not so for (?!), which was fixed
last time.

/be
Attachment #157203 - Flags: review?(shaver)
Attachment #157203 - Flags: review?(shaver)
Attachment #157203 - Flags: approval1.7.3?
Attachment #157203 - Flags: approval-aviary?
Comment on attachment 157203 [details] [diff] [review]
fix

a=chofmann for aviary and 1.7.3
Attachment #157203 - Flags: approval1.7.3?
Attachment #157203 - Flags: approval1.7.3+
Attachment #157203 - Flags: approval-aviary?
Attachment #157203 - Flags: approval-aviary+
Fixed on trunk and branches.

/be
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Comment on attachment 157203 [details] [diff] [review]
fix

a=chofmann for aviary and 1.7.3
Keywords: fixed1.7fixed1.7.x
thanks to be
js1_5/Regress/regress-256798.js checked in.
javascript:/b(?=(b+))/.exec("baaabac") + '' returns 'null' instead of 'b,b' in
sm 1.7.6 and trunk, ff 1.0x and trunk. Should this be reopened?
QA Contact: pschwartau → moz
Flags: testcase+
(In reply to comment #8)
> javascript:/b(?=(b+))/.exec("baaabac") + '' returns 'null' instead of 'b,b' in
> sm 1.7.6 and trunk, ff 1.0x and trunk. Should this be reopened?

Please file a new bug or bugs.  It looks like a bunch of stuff to-do with zero-width positive and negative lookahead is broken:

js> /(?!a)b/('zzzabzzz')
ab

mrbkap should take these bug(s) -- he didn't make this mess but he can fix it.

/be
(In reply to comment #9)

See bug 322836.

/be
verified fixed.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: