Closed Bug 1030305 Opened 10 years ago Closed 10 years ago

Array.indexOf polyfill

Categories

(Developer Documentation Graveyard :: JavaScript, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: imphil, Assigned: rwaldron)

Details

I got a mail from a contributor regarding the polyfill of Array.indexOf(), as documented here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf I quote from his mail: "use this testcase in IE8: var indexOf1 = [0, 1, 2, 3]; delete indexOf1[1]; delete indexOf1[3]; indexOf1.indexOf(undefined); // ==> 1, but i think the right result is -1 in the polyfill panel, should be add the condition "fromIndex in this" like this: for (; fromIndex < length; fromIndex++) { if (this[fromIndex] === searchElement && fromIndex in this) { return fromIndex; }} " I don't know if there really is a problem in the polyfill, could some JS hacker have a look at that?
Assignee: fscholz → waldron.rick
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Rick, thanks! Unfortunately the formatting got badly broken in MDN and I cannot really recover your original meaning, could you have a look at it again?
You need to log in before you can comment on or make changes to this bug.