ECMAScript compliance: passing a RegExp to the RegExp() constructor

VERIFIED FIXED

Status

Rhino
Core
P3
normal
VERIFIED FIXED
17 years ago
17 years ago

People

(Reporter: David Flanagan, Assigned: rogerl (gone))

Tracking

({js1.5})

Details

Attachments

(1 attachment)

(Reporter)

Description

17 years ago
Rhino has the same bug as spidermonkey, see bug #61266
(Reporter)

Updated

17 years ago
Keywords: js1.5

Comment 1

17 years ago
Fixed:

Checking in regexp/NativeRegExp.java;
/cvsroot/mozilla/js/rhino/org/mozilla/javascript/regexp/NativeRegExp.java,v  <--
  NativeRegExp.java
new revision: 1.23; previous revision: 1.22
done
Status: NEW → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED

Comment 2

17 years ago
(crossed signals - we were both looking at this!)

David pointed out another aspect of conformance to the spec in 61266; RegExp
called as a function with a RegExp argument should return the RegExp, also
throwing a typeerror if the flags argument is specified.

(For strict conformance, we should be checking against not supplied -or-
undefined; passing void 0 should be OK.  args[1] != Undefined.instance)

Also the message needs to be internationalized.  (When I fixed it in my tree, I
just reused msg.bad.param.)
Status: RESOLVED → REOPENED
Resolution: FIXED → ---

Comment 3

17 years ago
Does your fix address all of these? If so, just back out my fix and check 
yours in. 

And next time don't be afraid just reassign the bug to yourself so we avoid
duplication of effor.

Thanks,
Norris

Comment 4

17 years ago
Testcases in js/tests/ecma_3/RegExp are failing in Rhino for these reasons:


1. Passing a RegExp object to the RegExp() function is not returning the object
2. undefined is not being accepted as a valid flag parameter for RegExp()
3. RegExp() is segfaulting if either its pattern or flag parameter is invalid


Reassigning to rogerl, who has just fixed these same problems in SpiderMonkey.
Assignee: nboyd → rogerl
Status: REOPENED → NEW

Comment 5

17 years ago
Created attachment 20495 [details]
my Rhino test results for js/tests/ecma_3/RegExp/

Comment 6

17 years ago
Mike, do you have a fix for these problems?

Comment 7

17 years ago
If I had a fix, I misplaced it!

Roger and I just flipped for this, and he got it.

Comment 8

17 years ago
EEK!!! Apologies to everyone - I did not have the most recent Rhino source... 

All tests in js/tests/ecma_3/RegExp are passing in Rhino(both in compiled mode 
and interpreted mode) on these platforms:


                         WinNT   JDK 1.2.2
                         Linux   JDK 1.1.8


All three issues I mentioned above at 2000-12-11 16:03 seem to have been
addressed. Does this sound right - and is this bug ready to close, then?  


cc'ing Norris - 

Comment 9

17 years ago
Yes, I checked in fixes for these problems today.
Status: NEW → RESOLVED
Last Resolved: 17 years ago17 years ago
Resolution: --- → FIXED

Comment 10

17 years ago
Marking Verified -
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.