Side navigation
#5610 closed bug (worksforme)
Opened December 07, 2009 04:01PM UTC
Closed November 22, 2010 05:30AM UTC
Last modified January 31, 2011 05:55PM UTC
makeArray can cause browser crash on non array objects with length property
Reported by: | jwheare | Owned by: | |
---|---|---|---|
Priority: | high | Milestone: | 1.5 |
Component: | core | Version: | 1.5 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I haven't tested this with 1.4
For an object with a length property that casts to a non-zero positive integer, makeArray will create an array with that length filled with undefined.
>>> jQuery.makeArray({'length': '5'}) [undefined, undefined, undefined, undefined, undefined]
If the length property is zero, negative or a decimal then Firefox and Safari both hang. (FF shows the unresponsive script error, Safari hangs until it crashes)
>>> jQuery.makeArray({'length': '0'}) >>> jQuery.makeArray({'length': '5.2'}) >>> jQuery.makeArray({'length': '-3'})
Attachments (0)
Change History (5)
Changed December 10, 2009 05:44AM UTC by comment:1
resolution: | → fixed |
---|---|
status: | new → closed |
version: | 1.3.2 → 1.4a1 |
Changed May 21, 2010 08:25PM UTC by comment:2
resolution: | fixed |
---|---|
status: | closed → reopened |
This has not been corrected.
Try:
>>> jQuery.makeArray( {'length':5} );
in the firebug console on any jQuery site and it will output
[undefined, undefined, undefined, undefined, undefined]
when it should return
[Object { length=5}]
This is causing issues where I have an object with a length and width attribute, since it will not pass through makeArray properly.
Changed November 22, 2010 05:30AM UTC by comment:3
milestone: | 1.4 → 1.4.5 |
---|---|
priority: | major → high |
resolution: | → worksforme |
status: | reopened → closed |
version: | 1.4a1 → 1.4.4 |
It is working as designed.
Changed January 31, 2011 05:53PM UTC by comment:4
version: | 1.4.4 → 1.5 |
---|
There wasn't a 1.4.5 release, was actually 1.5.
Changed January 31, 2011 05:55PM UTC by comment:5
milestone: | 1.4.5 → 1.5 |
---|
There was no 1.4.5 release, was actually 1.5.
Fixed.
http://github.com/jquery/jquery/commit/715d1c5a30cc4986018bbf063713f14c34c3e258