Skip to main content

Bug Tracker

Side navigation

#4733 closed bug (worksforme)

Opened June 05, 2009 10:49PM UTC

Closed December 17, 2009 04:44AM UTC

makeArray sometimes breaks on DOM Elements

Reported by: appden Owned by: flesler
Priority: major Milestone: 1.4
Component: core Version: 1.3.2
Keywords: Cc: appden
Blocked by: Blocking:
Description

This function queries for a 'length' property and then makes a false assumption that a DOM element's 'length' is undefined. This sometimes is a false assumption and can cause havoc.

In my case, a Firefox 3 memory bug sometimes caused an element to return a *gigantic* number as its length, causing an unresponsive script error when makeArray tried to loop through that huge number.

makeArray should have a more explicit test on its input.

Attachments (1)
  • test-4733.html (0.4 KB) - added by dmethvin December 17, 2009 04:43AM UTC.

    $.makeArray(formelement)

Change History (3)

Changed June 05, 2009 10:53PM UTC by appden comment:1

BTW, my temporary fix was to overwrite the makeArray function and add a test to see if the input has a 'nodeType'. The Firefox 3 bug that I mentioned is filed here:

https://bugzilla.mozilla.org/show_bug.cgi?id=496652

Changed September 14, 2009 06:47PM UTC by flesler comment:2

cc: → appden
owner: → flesler

Changed December 17, 2009 04:44AM UTC by dmethvin comment:3

resolution: → worksforme
status: newclosed

Can you reopen this with a test case? It seems like DOM elements with a length should work properly. For example,

$.makeArray(formelement)
returns the form.elements collection as an Array. I've attached an example.