Closed Bug 835181 Opened 12 years ago Closed 9 years ago

Array apparently has an undocumented .iterator function (which broke Processing.js)

Categories

(Core :: JavaScript Engine, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: michiel, Unassigned)

Details

Apparently there is a new, undocumented, function ".iterator()" on Array in Firefox 17 and up, which is not listed in https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array, and which may cause scripts to break when they try to roll their own. Processing.js ran into this recently as documented in https://processing-js.lighthouseapp.com/projects/41284-processingjs/tickets/1935-the-for-each-loop-over-arrays-doesnt-work-on-firefox-17#ticket-1935-4 with the fix simply requiring a test to see if Array already had an .iterator() That said, given that Array already has a .forEach(), the presence of .iterator() might actually be a bug (it could be a native not-supposed-to-be-public function) so I figured I'd file this bug report.
This was done intentionally, as I understand it. If I'd had time to care, I probably would have argued against it some. jorendorff, this is another reason why having an @@iterator symbol, or whatever, that doesn't pollute the namespace of every object, is better than having a property name that does.
Assignee: general → nobody
Array.prototype.iterator was removed some time ago (probably as part of bug 919948) - resolving as WFM.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.