Closed
Bug 1030305
Opened 10 years ago
Closed 10 years ago
Array.indexOf polyfill
Categories
(Developer Documentation Graveyard :: JavaScript, defect)
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 | ||
Updated•10 years ago
|
Assignee: fscholz → waldron.rick
Assignee | ||
Comment 1•10 years ago
|
||
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 2•10 years ago
|
||
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?
Assignee | ||
Comment 3•10 years ago
|
||
That was very strange. It's all set now
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf$revision/640499
You need to log in
before you can comment on or make changes to this bug.
Description
•