Closed Bug 324006 Opened 19 years ago Closed 18 years ago

/foo/.constructor != RegExp what is wrong

Categories

(Rhino Graveyard :: Core, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mguillemot, Assigned: mguillemot)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7

Rhinon behaves differently than Firefox (or IE) when comparing a regexp constructor to the RegExp function:

/foo/.constructor == RegExp // true for FF or IE but false for Rhino 1.6R2

Reproducible: Always

Steps to Reproduce:
print /foo/.constructor == RegExp
Actual Results:  
false

Expected Results:  
true

org.mozilla.javascript.regexp.NativeRegExpCtor should perhaps override equivalentValues?
Reassigning to the reporter as I have neither interest nor time for Rhino.

See also bug 288433.

Assignee: igor.bukanov → mguillemot
Status: NEW → ASSIGNED
You're right - ECMA-262 15.10.6.1 says "The initial value of RegExp.prototype.constructor is the builtin RegExp constructor."

I added this property, so now

/foo/.constructor == RegExp

and

RegExp.prototype.constructor == RegExp

are both true. This is now fixed in CVS and will be in 1.6R3. 
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.