Closed Bug 93589 Opened 23 years ago Closed 23 years ago

Mozilla fails the RegExp portion of Netscapes ECMAScript tests

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

VERIFIED DUPLICATE of bug 61911

People

(Reporter: brianclark44, Assigned: rogerl)

References

()

Details

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Macintosh; U; PPC; en-US; rv:0.9.3) Gecko/20010802
BuildID:    2001080214

When testing Mozilla 0.9.3 for Mac with Netscape's ECMAScript test suite, it
fails the "tc_regx001 RegExp" portion of this test. 

http://developer.netscape.com/evangelism/tools/testsuites/tc.html?txtTitle=ECMAScript%203rd%20Edition&txtApiPath=ECMAScriptV3/&txtTestCases=tc&txtInvariantApiTestFrame=tc_invariantTestFrame&txtMutantApiTestFrame=tc_mutantTestFrame

If this link doesn't work for you, try clicking on the " ECMAScript Edition 3
Conformance" link on the following page:
http://developer.netscape.com/evangelism/tools/testsuites/


Reproducible: Always
Steps to Reproduce:
1.Go to the ECMAScript test that Netscape provides
2.Select the "tc_regx001 RegExp" test
3.Run it.
It looks like the testcase may be in error. I'm not used to this tool,
so I will cc bclary to see if we can get the text of the testcase.
What I see from the output is this: 


------------------------------------------------------------------
testcases.test.tc_regx001.object ECMAScript 262 
0 passed, 1 failed, 0 skipped out of 1 tests       
Expected Actual Result Error Message    
Test RegExp is a function
Test when: true #0: 

Equality Expression typeof(testcases.test.tc_regx001.object) 
Expect "object"
------------------------------------------------------------------


Again, without seeing the actual text of the testcase, I can't 
be sure, but if it's testing that the typeof a RegExp instance 
should be "object", that's a subtle issue. The typeof a RegExp instance
should be "function" : see bug 61911.
OS: Mac System 9.x → All
Hardware: Macintosh → All
cc'ing bclary to see how we might get a look at the "tc_regx001 RegExp" test 
to see exactly how it is failing - thx.
Here they are, but I don't think they will help that much.

http://developer.netscape.com/evangelism/tools/testsuites/ECMAScriptV3/tc_regx001.js
http://developer.netscape.com/evangelism/tools/testsuites/ECMAScriptV3/tc_invariantTestFrame.js

Basically, as you will see if you run the tests, the test in question creates a
regular expression using tc_regx001.object = new RegExp() and then performs a
number of tests assuming this is a standard JS object with a prototype etc.
However new RegExp() returns a function not an object, so the tests all fail.

javascript:alert(typeof(new RegExp()))



Bob: thanks, your test suite is awesome !!! 

Brian: thank you for this report, but I'm going to mark it
as a duplicate of bug 61911. It is a subtle issue as to why
new RegExp's have type 'function' and not 'object', but that's 
the way it's supposed to be per ECMA, as deliberated in the
earlier bug. 

*** This bug has been marked as a duplicate of 61911 ***
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
Marking Verified -
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.