Bug 14993 - Incorrect implementation of Array.prototype.indexOf
Summary: Incorrect implementation of Array.prototype.indexOf
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords: HasReduction
Depends on:
Blocks:
 
Reported: 2007-08-16 19:40 PDT by Erik Arvidsson
Modified: 2007-08-20 22:13 PDT (History)
2 users (show)

See Also:


Attachments
Testcase (515 bytes, text/html)
2007-08-16 19:41 PDT, Erik Arvidsson
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Arvidsson 2007-08-16 19:40:38 PDT
Given an array where elements have been removed indexOf will match undefined to the deleted elements.

var a = [0, 1, 2, 3];
delete a[1];
a.indexOf(undefined)

test case coming...
Comment 1 Erik Arvidsson 2007-08-16 19:41:49 PDT
Created attachment 16002 [details]
Testcase

All text should be green
Comment 2 Mark Rowe (bdash) 2007-08-16 20:12:57 PDT
Your test case gives me:

4
false
false
-1

All are green.  That would suggest we're already handling this correctly?

Comment 3 Jeff Walden (remove +bwo to email) 2007-08-20 15:53:36 PDT
I strongly suspect this got fixed by my patch for bug 12963 and that the nightly used to test this was out-of-date.
Comment 4 David Kilzer (:ddkilzer) 2007-08-20 22:13:15 PDT
Resolving as fixed per previous comments.