<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,5 @@
+* Improve NodeList detection for Safari's $A function. [Garrett Smith, jddalton]
+
 * Use different tactic to sniff for Opera in order to avoid false positives in IE. [Tobie Langel, jddalton]
 
 * Rename variable in Form.Element.Serializers.select. (jddalton)</diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -8,9 +8,13 @@ function $A(iterable) {
 
 if (Prototype.Browser.WebKit) {
   $A = function(iterable) {
-    if (!iterable) return [];
-    if (!(Object.isFunction(iterable) &amp;&amp; iterable == '[object NodeList]') &amp;&amp;
-        iterable.toArray) return iterable.toArray();
+    if (!iterable) return [];    
+    // In Safari, only use the `toArray` method if it's not a NodeList.
+    // A NodeList is a function, has an function `item` property, and a numeric
+    // `length` property. Adapted from Google Doctype.
+    if (!(typeof iterable === 'function' &amp;&amp; typeof iterable.length ===
+        'number' &amp;&amp; typeof iterable.item === 'function') &amp;&amp; iterable.toArray)
+      return iterable.toArray();
     var length = iterable.length || 0, results = new Array(length);
     while (length--) results[length] = iterable[length];
     return results;</diff>
      <filename>src/array.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>5ddfad8a6275b1f0c73c15f9bfd3ed4269ba59bf</id>
    </parent>
  </parents>
  <author>
    <name>Andrew Dupont</name>
    <email>prototype@andrewdupont.net</email>
  </author>
  <url>http://github.com/savetheclocktower/prototype/commit/b7af8a745b6ee6a75769383277a5e8c92a98d268</url>
  <id>b7af8a745b6ee6a75769383277a5e8c92a98d268</id>
  <committed-date>2008-09-07T20:19:05-07:00</committed-date>
  <authored-date>2008-07-17T13:31:28-07:00</authored-date>
  <message>Improve NodeList detection for Safari's $A function. [#187 state:resolved]</message>
  <tree>791a5bbb7af14c4775ed606116de7ec4e3eb456f</tree>
  <committer>
    <name>Tobie Langel</name>
    <email>tobie.langel@gmail.com</email>
  </committer>
</commit>
