#6825 closed enhancement (fixed)
Use Array.isArray for jQuery.isArray when available
Reported by: | salty-horse | Owned by: | |
---|---|---|---|
Priority: | Milestone: | 1.4.3 | |
Component: | core | Version: | 1.4.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Originally posted on the forum
Patch available on github: http://github.com/salty-horse/jquery/commits/array
ECMAScript 5 defines Array.isArray which is available in Firefox and WebKit (only ones I checked).
I think jQuery should use it, if available, instead of checking the object's toString being "[object Array]".
For one, it will solve a problem I have with WebKit and Qt. It allows one to expose Qt arrays in javascript, but those are of the RuntimeArray class. This causes the jQuery isArray function to fail identifying them as arrays, while the native Array isArray succeeds.
Note: See
TracTickets for help on using
tickets.
Fixed http://github.com/jquery/jquery/commit/ea8b1584b1905bbb414dc2e3cf562c6f3904bd97