Ticket #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: | ||
| Blocking: | Blocked by: |
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.
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Fixed http://github.com/jquery/jquery/commit/ea8b1584b1905bbb414dc2e3cf562c6f3904bd97