Closed Bug 415451 Opened 17 years ago Closed 17 years ago

Array.lastIndexOf does not work correctly

Categories

(Rhino Graveyard :: Core, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: asashour, Unassigned)

Details

Attachments

(1 file)

User-Agent:       Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)
Build Identifier: 

The following code should return 3 instead of 0.

[2, 5, 9, 2].lastIndexOf(2,-1)

Reproducible: Always

Steps to Reproduce:
1.
2.
3.


Expected Results:  
3
Proposed test case
Checking in src/org/mozilla/javascript/NativeArray.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/NativeArray.java,v  <--  Na tiveArray.java
new revision: 1.86; previous revision: 1.85
done

Checking in NativeArray.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/NativeArray.java,v  <--  NativeArray.java
new revision: 1.83.2.3; previous revision: 1.83.2.2
done
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Bob, can you review the proposed regression test when you have a chance?
Comment on attachment 301267 [details]
js1_5/Regress/regress-415451.js

r+ but put it in js1_5/extensions since Array.prototype.indexOf is not required by the standard.

Could you flip the in-litmus flag to - and the in-testsuite flag to + when you check in please?
Attachment #301267 - Flags: review+
Actually, js1_6/Array is the better place for this.
Checking in js1_6/Array/regress-415451.js;
/cvsroot/mozilla/js/tests/js1_6/Array/regress-415451.js,v  <--  regress-415451.js
initial revision: 1.1
done

Also flipped bits.
Flags: in-testsuite+
Flags: in-litmus-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: