/foo/.constructor != RegExp what is wrong

RESOLVED FIXED

Status

Rhino
Core
RESOLVED FIXED
13 years ago
12 years ago

People

(Reporter: Marc, Assigned: Marc)

Tracking

Details

(Assignee)

Description

13 years ago
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?

Comment 1

12 years ago
Reassigning to the reporter as I have neither interest nor time for Rhino.

See also bug 288433.

Assignee: igor.bukanov → mguillemot

Updated

12 years ago
Status: NEW → ASSIGNED

Comment 2

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