Bug Tracker

Opened 6 years ago

Closed 6 years ago

Last modified 4 years ago

#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.

Change History (1)

comment:1 Changed 6 years ago by john

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.