Rhino has the same bug as spidermonkey, see bug #61266
(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 != Undefined.instance) Also the message needs to be internationalized. (When I fixed it in my tree, I just reused msg.bad.param.)
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
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.
Mike, do you have a fix for these problems?
If I had a fix, I misplaced it! Roger and I just flipped for this, and he got it.
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 -
Yes, I checked in fixes for these problems today.
Marking Verified -