<?xml version="1.0" encoding="UTF-8"?>
<ticket>
  <assigned-user-id type="integer" nil="true"></assigned-user-id>
  <attachments-count type="integer">2</attachments-count>
  <closed type="boolean">false</closed>
  <created-at type="datetime">2008-11-14T14:45:10+01:00</created-at>
  <creator-id type="integer">16084</creator-id>
  <milestone-due-on type="datetime" nil="true"></milestone-due-on>
  <milestone-id type="integer">9616</milestone-id>
  <number type="integer">443</number>
  <permalink>objectisdate-method</permalink>
  <priority type="integer">20</priority>
  <project-id type="integer">8886</project-id>
  <raw-data type="binary" nil="true" encoding="base64"></raw-data>
  <state>enhancement</state>
  <tag>patched</tag>
  <title>Object.isDate method</title>
  <updated-at type="datetime">2009-11-16T16:50:18+01:00</updated-at>
  <user-id type="integer">32948</user-id>
  <user-name>T.J. Crowder</user-name>
  <creator-name>Nesterenko Dmitry</creator-name>
  <url>http://prototype.lighthouseapp.com/projects/8886/tickets/443</url>
  <milestone-title>1.7</milestone-title>
  <original-body>@@@ javascript
Object.extend(Object, {
    /**
     * Returns true if object is instance of Date.
     */
    isDate: function(object)
    {
        return object.constructor == Date
    }
})
javascript</original-body>
  <latest-body>@@@ javascript
Object.extend(Object, {
    /**
     * Returns true if object is instance of Date.
     */
    isDate: function(object)
    {
        return object.constructor == Date
    }
})
javascript</latest-body>
  <original-body-html>&lt;div&gt;&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;
Object.extend(Object, {
    /**
     * Returns true if object is instance of Date.
     */
    isDate: function(object)
    {
        return object.constructor == Date
    }
})
javascript@@@
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</original-body-html>
  <versions type="array">
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>@@@ javascript
Object.extend(Object, {
    /**
     * Returns true if object is instance of Date.
     */
    isDate: function(object)
    {
        return object.constructor == Date
    }
})
@@@</body>
      <body-html>&lt;div&gt;&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;
Object.extend(Object, {
    /**
     * Returns true if object is instance of Date.
     */
    isDate: function(object)
    {
        return object.constructor == Date
    }
})
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-11-14T14:45:11+01:00</created-at>
      <creator-id type="integer">16084</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">443</number>
      <permalink>objectisdate-method</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8886</project-id>
      <state>new</state>
      <tag nil="true"></tag>
      <title>Object.isDate method</title>
      <updated-at type="datetime">2009-01-05T23:39:18+01:00</updated-at>
      <user-id type="integer">16084</user-id>
      <user-name>Nesterenko Dmitry</user-name>
      <creator-name>Nesterenko Dmitry</creator-name>
      <url>http://prototype.lighthouseapp.com/projects/8886/tickets/443</url>
      <milestone-title nil="true"></milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Since Date is standard object in javascript, prototype should have method to detect it.</body>
      <body-html>&lt;div&gt;&lt;p&gt;Since Date is standard object in javascript, prototype should
have method to detect it.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-11-14T14:46:24+01:00</created-at>
      <creator-id type="integer">16084</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">443</number>
      <permalink>objectisdate-method</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8886</project-id>
      <state>new</state>
      <tag nil="true"></tag>
      <title>Object.isDate method</title>
      <updated-at type="datetime">2008-11-14T14:46:26+01:00</updated-at>
      <user-id type="integer">16084</user-id>
      <user-name>Nesterenko Dmitry</user-name>
      <creator-name>Nesterenko Dmitry</creator-name>
      <url>http://prototype.lighthouseapp.com/projects/8886/tickets/443</url>
      <milestone-title nil="true"></milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>To make it into core, this would need a solution that works cross-frame.</body>
      <body-html>&lt;div&gt;&lt;p&gt;To make it into core, this would need a solution that works
cross-frame.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-11-14T17:51:35+01:00</created-at>
      <creator-id type="integer">16084</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">443</number>
      <permalink>objectisdate-method</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8886</project-id>
      <state>new</state>
      <tag nil="true"></tag>
      <title>Object.isDate method</title>
      <updated-at type="datetime">2008-11-14T17:51:39+01:00</updated-at>
      <user-id type="integer">14168</user-id>
      <user-name>Tobie Langel</user-name>
      <creator-name>Nesterenko Dmitry</creator-name>
      <url>http://prototype.lighthouseapp.com/projects/8886/tickets/443</url>
      <milestone-title nil="true"></milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">14168</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body></body>
      <body-html></body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-11-14T17:53:25+01:00</created-at>
      <creator-id type="integer">16084</creator-id>
      <diffable-attributes type="yaml">--- 
:tag: 
:state: new
:assigned_user: 
</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">443</number>
      <permalink>objectisdate-method</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8886</project-id>
      <state>enhancement</state>
      <tag>needs_patch needs_tests</tag>
      <title>Object.isDate method</title>
      <updated-at type="datetime">2008-11-14T17:53:27+01:00</updated-at>
      <user-id type="integer">14168</user-id>
      <user-name>Tobie Langel</user-name>
      <creator-name>Nesterenko Dmitry</creator-name>
      <url>http://prototype.lighthouseapp.com/projects/8886/tickets/443</url>
      <milestone-title nil="true"></milestone-title>
      <assigned-user-name>Tobie Langel</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">14168</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>what does mean &#171;cross-frame&#187;?</body>
      <body-html>&lt;div&gt;&lt;p&gt;what does mean &amp;laquo;cross-frame&amp;raquo;?&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-11-14T18:41:00+01:00</created-at>
      <creator-id type="integer">16084</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">443</number>
      <permalink>objectisdate-method</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8886</project-id>
      <state>enhancement</state>
      <tag>needs_patch needs_tests</tag>
      <title>Object.isDate method</title>
      <updated-at type="datetime">2008-11-14T18:41:02+01:00</updated-at>
      <user-id type="integer">16084</user-id>
      <user-name>Nesterenko Dmitry</user-name>
      <creator-name>Nesterenko Dmitry</creator-name>
      <url>http://prototype.lighthouseapp.com/projects/8886/tickets/443</url>
      <milestone-title nil="true"></milestone-title>
      <assigned-user-name>Tobie Langel</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">14168</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Dmitry,

@@@ javascript
document.body.appendChild(document.createElement('iframe'));
var xDate = frames[frames.length-1].Date;

xDate === Date; // false
(new xDate()).constructor === Date; // false
(new xDate()) instanceof Date; // false
@@@</body>
      <body-html>&lt;div&gt;&lt;p&gt;Dmitry,&lt;/p&gt;


&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;
document.body.appendChild(document.createElement('iframe'));
var xDate = frames[frames.length-1].Date;

xDate === Date; // false
(new xDate()).constructor === Date; // false
(new xDate()) instanceof Date; // false
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-11-14T20:42:57+01:00</created-at>
      <creator-id type="integer">16084</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">443</number>
      <permalink>objectisdate-method</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8886</project-id>
      <state>enhancement</state>
      <tag>needs_patch needs_tests</tag>
      <title>Object.isDate method</title>
      <updated-at type="datetime">2008-11-14T20:44:18+01:00</updated-at>
      <user-id type="integer">15559</user-id>
      <user-name>Juriy Zaytsev</user-name>
      <creator-name>Nesterenko Dmitry</creator-name>
      <url>http://prototype.lighthouseapp.com/projects/8886/tickets/443</url>
      <milestone-title nil="true"></milestone-title>
      <assigned-user-name>Tobie Langel</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">14168</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>One way to &quot;solve&quot; x-frame issue is to use `Object.prototype.toString` which returns `this` object's internal [[Class]] (as part of the resulting string - see 15.2.4.2). Since Date's [[Class]] is specified to be that of &quot;Date&quot; (see 15.9.3.3), I'm pretty sure this solution is viable as long as browser conforms to specification:

@@@ javascript
function isDate(o) {
  return Object.prototype.toString.call(o).indexOf('Date') != -1;
}

// test

document.body.appendChild(document.createElement('iframe'));
var xDate = frames[frames.length-1].Date;

isDate(new Date()); // true
isDate(new xDate()); // true
isDate({}); // false

// etc.
@@@</body>
      <body-html>&lt;div&gt;&lt;p&gt;One way to &quot;solve&quot; x-frame issue is to use
&lt;code&gt;Object.prototype.toString&lt;/code&gt; which returns
&lt;code&gt;this&lt;/code&gt; object's internal [[Class]] (as part of the
resulting string - see 15.2.4.2). Since Date's [[Class]] is
specified to be that of &quot;Date&quot; (see 15.9.3.3), I'm pretty sure this
solution is viable as long as browser conforms to
specification:&lt;/p&gt;


&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;
function isDate(o) {
  return Object.prototype.toString.call(o).indexOf('Date') != -1;
}

// test

document.body.appendChild(document.createElement('iframe'));
var xDate = frames[frames.length-1].Date;

isDate(new Date()); // true
isDate(new xDate()); // true
isDate({}); // false

// etc.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-11-14T20:52:56+01:00</created-at>
      <creator-id type="integer">16084</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">443</number>
      <permalink>objectisdate-method</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8886</project-id>
      <state>enhancement</state>
      <tag>needs_patch needs_tests</tag>
      <title>Object.isDate method</title>
      <updated-at type="datetime">2008-11-14T20:52:57+01:00</updated-at>
      <user-id type="integer">15559</user-id>
      <user-name>Juriy Zaytsev</user-name>
      <creator-name>Nesterenko Dmitry</creator-name>
      <url>http://prototype.lighthouseapp.com/projects/8886/tickets/443</url>
      <milestone-title nil="true"></milestone-title>
      <assigned-user-name>Tobie Langel</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">14168</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Another option is to test for a couple of `Date` methods &#8212; of which there are a crapload. Most have very specific names that are unlikely to cause false positives.</body>
      <body-html>&lt;div&gt;&lt;p&gt;Another option is to test for a couple of &lt;code&gt;Date&lt;/code&gt;
methods &amp;#8212; of which there are a crapload. Most have very
specific names that are unlikely to cause false positives.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-11-14T20:58:06+01:00</created-at>
      <creator-id type="integer">16084</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">443</number>
      <permalink>objectisdate-method</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8886</project-id>
      <state>enhancement</state>
      <tag>needs_patch needs_tests</tag>
      <title>Object.isDate method</title>
      <updated-at type="datetime">2008-11-14T20:58:09+01:00</updated-at>
      <user-id type="integer">15556</user-id>
      <user-name>Andrew Dupont</user-name>
      <creator-name>Nesterenko Dmitry</creator-name>
      <url>http://prototype.lighthouseapp.com/projects/8886/tickets/443</url>
      <milestone-title nil="true"></milestone-title>
      <assigned-user-name>Tobie Langel</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">14168</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>So which one do you think we should go with? Test methods presence or checking [[Class]] value? 

Thoughts, anyone?</body>
      <body-html>&lt;div&gt;&lt;p&gt;So which one do you think we should go with? Test methods
presence or checking [[Class]] value?&lt;/p&gt;
&lt;p&gt;Thoughts, anyone?&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-12-13T07:01:13+01:00</created-at>
      <creator-id type="integer">16084</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">443</number>
      <permalink>objectisdate-method</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8886</project-id>
      <state>enhancement</state>
      <tag>needs_patch needs_tests</tag>
      <title>Object.isDate method</title>
      <updated-at type="datetime">2008-12-13T07:01:15+01:00</updated-at>
      <user-id type="integer">15559</user-id>
      <user-name>Juriy Zaytsev</user-name>
      <creator-name>Nesterenko Dmitry</creator-name>
      <url>http://prototype.lighthouseapp.com/projects/8886/tickets/443</url>
      <milestone-title nil="true"></milestone-title>
      <assigned-user-name>Tobie Langel</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">14168</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>@kangax: the former.</body>
      <body-html>&lt;div&gt;&lt;p&gt;@kangax: the former.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-12-13T16:46:19+01:00</created-at>
      <creator-id type="integer">16084</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">443</number>
      <permalink>objectisdate-method</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8886</project-id>
      <state>enhancement</state>
      <tag>needs_patch needs_tests</tag>
      <title>Object.isDate method</title>
      <updated-at type="datetime">2008-12-13T16:46:23+01:00</updated-at>
      <user-id type="integer">14168</user-id>
      <user-name>Tobie Langel</user-name>
      <creator-name>Nesterenko Dmitry</creator-name>
      <url>http://prototype.lighthouseapp.com/projects/8886/tickets/443</url>
      <milestone-title nil="true"></milestone-title>
      <assigned-user-name>Tobie Langel</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">14168</assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Ok. I guess something along these lines then:

@@@ javascript
function isDate(o) {
  return !!(o &amp;&amp; typeof o == 'object' &amp;&amp; 'getDate' in o &amp;&amp; 
    'getFullYear' in o &amp;&amp; 'setMilliseconds' in o);
}
@@@</body>
      <body-html>&lt;div&gt;&lt;p&gt;Ok. I guess something along these lines then:&lt;/p&gt;


&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;
function isDate(o) {
  return !!(o &amp;amp;&amp;amp; typeof o == 'object' &amp;amp;&amp;amp; 'getDate' in o &amp;amp;&amp;amp; 
    'getFullYear' in o &amp;amp;&amp;amp; 'setMilliseconds' in o);
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-12-14T03:11:47+01:00</created-at>
      <creator-id type="integer">16084</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">443</number>
      <permalink>objectisdate-method</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8886</project-id>
      <state>enhancement</state>
      <tag>needs_patch needs_tests</tag>
      <title>Object.isDate method</title>
      <updated-at type="datetime">2008-12-14T03:11:53+01:00</updated-at>
      <user-id type="integer">15559</user-id>
      <user-name>Juriy Zaytsev</user-name>
      <creator-name>Nesterenko Dmitry</creator-name>
      <url>http://prototype.lighthouseapp.com/projects/8886/tickets/443</url>
      <milestone-title nil="true"></milestone-title>
      <assigned-user-name>Tobie Langel</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">14168</assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>Your code returns xDate being undefined in IE6/7. On line:
@@@javascript
xDate = frames[frames.length-1].Date;
@@@</body>
      <body-html>&lt;div&gt;&lt;p&gt;Your code returns xDate being undefined in IE6/7. On line:
@@@javascript xDate = frames[frames.length-1].Date;&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-01-05T23:32:12+01:00</created-at>
      <creator-id type="integer">16084</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">443</number>
      <permalink>objectisdate-method</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8886</project-id>
      <state>enhancement</state>
      <tag>needs_patch needs_tests</tag>
      <title>Object.isDate method</title>
      <updated-at type="datetime">2009-01-05T23:32:14+01:00</updated-at>
      <user-id type="integer">16084</user-id>
      <user-name>Nesterenko Dmitry</user-name>
      <creator-name>Nesterenko Dmitry</creator-name>
      <url>http://prototype.lighthouseapp.com/projects/8886/tickets/443</url>
      <milestone-title nil="true"></milestone-title>
      <assigned-user-name>Tobie Langel</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">14168</assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>Why don't we use toString() method on object's constructor and match it with Date.toString

@@@ javascript
Object.isDate = function(object){
  return object.constructor &amp;&amp; object.constructor.toString() === Date.toString();
}
@@@</body>
      <body-html>&lt;div&gt;&lt;p&gt;Why don't we use toString() method on object's constructor and
match it with Date.toString&lt;/p&gt;


&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;
Object.isDate = function(object){
  return object.constructor &amp;amp;&amp;amp; object.constructor.toString() === Date.toString();
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-01-06T00:53:05+01:00</created-at>
      <creator-id type="integer">16084</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">443</number>
      <permalink>objectisdate-method</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8886</project-id>
      <state>enhancement</state>
      <tag>needs_patch needs_tests</tag>
      <title>Object.isDate method</title>
      <updated-at type="datetime">2009-01-06T00:53:10+01:00</updated-at>
      <user-id type="integer">29239</user-id>
      <user-name>Radoslav Stankov</user-name>
      <creator-name>Nesterenko Dmitry</creator-name>
      <url>http://prototype.lighthouseapp.com/projects/8886/tickets/443</url>
      <milestone-title nil="true"></milestone-title>
      <assigned-user-name>Tobie Langel</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">14168</assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>@Radoslav Stankov: that's relying on function de-compilation, which isn't ECMAScript compliant, isn't supported on all browsers (notably Opera mini)... and can be costly depending on the implementation.</body>
      <body-html>&lt;div&gt;&lt;p&gt;@Radoslav Stankov: that's relying on function de-compilation,
which isn't ECMAScript compliant, isn't supported on all browsers
(notably Opera mini)... and can be costly depending on the
implementation.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-01-06T01:24:54+01:00</created-at>
      <creator-id type="integer">16084</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">443</number>
      <permalink>objectisdate-method</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8886</project-id>
      <state>enhancement</state>
      <tag>needs_patch needs_tests</tag>
      <title>Object.isDate method</title>
      <updated-at type="datetime">2009-01-06T01:24:58+01:00</updated-at>
      <user-id type="integer">14168</user-id>
      <user-name>Tobie Langel</user-name>
      <creator-name>Nesterenko Dmitry</creator-name>
      <url>http://prototype.lighthouseapp.com/projects/8886/tickets/443</url>
      <milestone-title nil="true"></milestone-title>
      <assigned-user-name>Tobie Langel</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">14168</assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>@Dmitry

IE seems to &quot;populate&quot; a proper context (iframe's DOM) only when frame's content is finished loading. It's easy to modify the test to set iframe's `src` attribute, then poll for iframe DOM to be ready and - once finished - use its `Array` in a test.</body>
      <body-html>&lt;div&gt;&lt;p&gt;@Dmitry&lt;/p&gt;
&lt;p&gt;IE seems to &quot;populate&quot; a proper context (iframe's DOM) only when
frame's content is finished loading. It's easy to modify the test
to set iframe's &lt;code&gt;src&lt;/code&gt; attribute, then poll for iframe
DOM to be ready and - once finished - use its &lt;code&gt;Array&lt;/code&gt; in
a test.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-01-06T03:24:13+01:00</created-at>
      <creator-id type="integer">16084</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">443</number>
      <permalink>objectisdate-method</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8886</project-id>
      <state>enhancement</state>
      <tag>needs_patch needs_tests</tag>
      <title>Object.isDate method</title>
      <updated-at type="datetime">2009-01-06T03:24:14+01:00</updated-at>
      <user-id type="integer">15559</user-id>
      <user-name>Juriy Zaytsev</user-name>
      <creator-name>Nesterenko Dmitry</creator-name>
      <url>http://prototype.lighthouseapp.com/projects/8886/tickets/443</url>
      <milestone-title nil="true"></milestone-title>
      <assigned-user-name>Tobie Langel</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">14168</assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>Juriy, why don't you want to use kangax's method, i found in his protolicious: http://github.com/kangax/protolicious/tree/master/experimental/__getClass.js

@@@ javascript
function __getClass(object){
  return Object.prototype.toString.call(object)
    .match(/^\[object\s(.*)\]$/)[1];
};
@@@

it passes all your test cases in isDate.js</body>
      <body-html>&lt;div&gt;&lt;p&gt;Juriy, why don't you want to use kangax's method, i found in his
protolicious: &lt;a href=&quot;http://github.com/kangax/protolicious/tree/master/experimental/__getClass.js&quot;&gt;
http://github.com/kangax/protoli...&lt;/a&gt;&lt;/p&gt;


&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;
function __getClass(object){
  return Object.prototype.toString.call(object)
    .match(/^\[object\s(.*)\]$/)[1];
};
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;it passes all your test cases in isDate.js&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-01-06T09:50:28+01:00</created-at>
      <creator-id type="integer">16084</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">443</number>
      <permalink>objectisdate-method</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8886</project-id>
      <state>enhancement</state>
      <tag>needs_patch needs_tests</tag>
      <title>Object.isDate method</title>
      <updated-at type="datetime">2009-01-06T09:50:30+01:00</updated-at>
      <user-id type="integer">16084</user-id>
      <user-name>Nesterenko Dmitry</user-name>
      <creator-name>Nesterenko Dmitry</creator-name>
      <url>http://prototype.lighthouseapp.com/projects/8886/tickets/443</url>
      <milestone-title nil="true"></milestone-title>
      <assigned-user-name>Tobie Langel</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">14168</assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>@Nesterenko Dmitry: Juriy Zaytsev === kangax :)</body>
      <body-html>&lt;div&gt;&lt;p&gt;@Nesterenko Dmitry: Juriy Zaytsev === kangax :)&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-01-06T12:25:04+01:00</created-at>
      <creator-id type="integer">16084</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">443</number>
      <permalink>objectisdate-method</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8886</project-id>
      <state>enhancement</state>
      <tag>needs_patch needs_tests</tag>
      <title>Object.isDate method</title>
      <updated-at type="datetime">2009-01-06T12:25:06+01:00</updated-at>
      <user-id type="integer">14168</user-id>
      <user-name>Tobie Langel</user-name>
      <creator-name>Nesterenko Dmitry</creator-name>
      <url>http://prototype.lighthouseapp.com/projects/8886/tickets/443</url>
      <milestone-title nil="true"></milestone-title>
      <assigned-user-name>Tobie Langel</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">14168</assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>sorry, i realized later that it's the same person reading kangax's profile ))</body>
      <body-html>&lt;div&gt;&lt;p&gt;sorry, i realized later that it's the same person reading
kangax's profile ))&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-01-06T12:32:10+01:00</created-at>
      <creator-id type="integer">16084</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">443</number>
      <permalink>objectisdate-method</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8886</project-id>
      <state>enhancement</state>
      <tag>needs_patch needs_tests</tag>
      <title>Object.isDate method</title>
      <updated-at type="datetime">2009-01-06T12:32:12+01:00</updated-at>
      <user-id type="integer">16084</user-id>
      <user-name>Nesterenko Dmitry</user-name>
      <creator-name>Nesterenko Dmitry</creator-name>
      <url>http://prototype.lighthouseapp.com/projects/8886/tickets/443</url>
      <milestone-title nil="true"></milestone-title>
      <assigned-user-name>Tobie Langel</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">14168</assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>I actually do want to take advantage of [[Class]] (see my previous comment in this thread). `Object.prototype.toString` behavior is unambigous and (contrary to `Function.prototype.toString`) always guarantees to include value of [[Class]] at a specified position in a string. 

`Object.isArray` is another method that could benefit from `getClass`. Looking at ES3.1 spec draft, it seems like their `Array.isArray` is defined very similar - by checking whether object's [[Class]] has a value of &quot;Array&quot;:

&gt; 15.4.3.2 Array.isArray ( arg ) The isArray function takes one argument arg, and returns the Boolean value true if the argument is an object whose [[Class]] internal property has the string value &quot;Array&quot;; otherwise it return false.

When I get I chance, I'll run tests on more browsers than those covered by prototype (just to check how compliant they are in this regard)</body>
      <body-html>&lt;div&gt;&lt;p&gt;I actually do want to take advantage of [[Class]] (see my
previous comment in this thread).
&lt;code&gt;Object.prototype.toString&lt;/code&gt; behavior is unambigous and
(contrary to &lt;code&gt;Function.prototype.toString&lt;/code&gt;) always
guarantees to include value of [[Class]] at a specified position in
a string.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Object.isArray&lt;/code&gt; is another method that could benefit
from &lt;code&gt;getClass&lt;/code&gt;. Looking at ES3.1 spec draft, it seems
like their &lt;code&gt;Array.isArray&lt;/code&gt; is defined very similar - by
checking whether object's [[Class]] has a value of &quot;Array&quot;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;15.4.3.2 Array.isArray ( arg ) The isArray function takes one
argument arg, and returns the Boolean value true if the argument is
an object whose [[Class]] internal property has the string value
&quot;Array&quot;; otherwise it return false.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;When I get I chance, I'll run tests on more browsers than those
covered by prototype (just to check how compliant they are in this
regard)&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-01-06T14:42:23+01:00</created-at>
      <creator-id type="integer">16084</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">443</number>
      <permalink>objectisdate-method</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8886</project-id>
      <state>enhancement</state>
      <tag>needs_patch needs_tests</tag>
      <title>Object.isDate method</title>
      <updated-at type="datetime">2009-01-06T14:42:26+01:00</updated-at>
      <user-id type="integer">15559</user-id>
      <user-name>Juriy Zaytsev</user-name>
      <creator-name>Nesterenko Dmitry</creator-name>
      <url>http://prototype.lighthouseapp.com/projects/8886/tickets/443</url>
      <milestone-title nil="true"></milestone-title>
      <assigned-user-name>Tobie Langel</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">14168</assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>Tested positive on:

Desktop:

* Firefox 2.0.0.18, 3.0.5
* Safari 2.0.2 - 3.2.1
* Chrome 1.0.154.36
* Opera 9.27 - 10a
* IE 5.5 - 8RC1

Mobile:

* Opera Mini 4.2
* MSIEMobile 4.01, 6.0
* Blackberry 8100, 8320, 9000, 9530
* Android 1.0
* Fennec 1.0a1
* Safari Mobile 3.1.1

Which one did I miss?</body>
      <body-html>&lt;div&gt;&lt;p&gt;Tested positive on:&lt;/p&gt;
&lt;p&gt;Desktop:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Firefox 2.0.0.18, 3.0.5&lt;/li&gt;
&lt;li&gt;Safari 2.0.2 - 3.2.1&lt;/li&gt;
&lt;li&gt;Chrome 1.0.154.36&lt;/li&gt;
&lt;li&gt;Opera 9.27 - 10a&lt;/li&gt;
&lt;li&gt;IE 5.5 - 8RC1&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Mobile:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Opera Mini 4.2&lt;/li&gt;
&lt;li&gt;MSIEMobile 4.01, 6.0&lt;/li&gt;
&lt;li&gt;Blackberry 8100, 8320, 9000, 9530&lt;/li&gt;
&lt;li&gt;Android 1.0&lt;/li&gt;
&lt;li&gt;Fennec 1.0a1&lt;/li&gt;
&lt;li&gt;Safari Mobile 3.1.1&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Which one did I miss?&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-01-07T02:04:50+01:00</created-at>
      <creator-id type="integer">16084</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">443</number>
      <permalink>objectisdate-method</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8886</project-id>
      <state>enhancement</state>
      <tag>needs_patch needs_tests</tag>
      <title>Object.isDate method</title>
      <updated-at type="datetime">2009-01-07T02:07:13+01:00</updated-at>
      <user-id type="integer">15559</user-id>
      <user-name>Juriy Zaytsev</user-name>
      <creator-name>Nesterenko Dmitry</creator-name>
      <url>http://prototype.lighthouseapp.com/projects/8886/tickets/443</url>
      <milestone-title nil="true"></milestone-title>
      <assigned-user-name>Tobie Langel</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">14168</assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>er... Camino, flock, Avant Browser, Konqueror, Lynx, Flock, Arachne, Epiphany, K-Meleon... ;)

Awesome find kangax!</body>
      <body-html>&lt;div&gt;&lt;p&gt;er... Camino, flock, Avant Browser, Konqueror, Lynx, Flock,
Arachne, Epiphany, K-Meleon... ;)&lt;/p&gt;
&lt;p&gt;Awesome find kangax!&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-01-07T02:25:25+01:00</created-at>
      <creator-id type="integer">16084</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">443</number>
      <permalink>objectisdate-method</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8886</project-id>
      <state>enhancement</state>
      <tag>needs_patch needs_tests</tag>
      <title>Object.isDate method</title>
      <updated-at type="datetime">2009-01-07T02:25:29+01:00</updated-at>
      <user-id type="integer">14168</user-id>
      <user-name>Tobie Langel</user-name>
      <creator-name>Nesterenko Dmitry</creator-name>
      <url>http://prototype.lighthouseapp.com/projects/8886/tickets/443</url>
      <milestone-title nil="true"></milestone-title>
      <assigned-user-name>Tobie Langel</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">14168</assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>Have you checked what was rendered for host objects in the different browsers ?</body>
      <body-html>&lt;div&gt;&lt;p&gt;Have you checked what was rendered for host objects in the
different browsers ?&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-01-07T02:28:21+01:00</created-at>
      <creator-id type="integer">16084</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">443</number>
      <permalink>objectisdate-method</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8886</project-id>
      <state>enhancement</state>
      <tag>needs_patch needs_tests</tag>
      <title>Object.isDate method</title>
      <updated-at type="datetime">2009-01-07T02:28:23+01:00</updated-at>
      <user-id type="integer">14168</user-id>
      <user-name>Tobie Langel</user-name>
      <creator-name>Nesterenko Dmitry</creator-name>
      <url>http://prototype.lighthouseapp.com/projects/8886/tickets/443</url>
      <milestone-title nil="true"></milestone-title>
      <assigned-user-name>Tobie Langel</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">14168</assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>Tobie,

I remember host objects yielding pretty strange values in some of the browsers : ) You can see some of them in comments of the original `__getClass` [1] 

I'm a bit worried about host objects throwing errors when asked for [[Class]] (if it is, say, unimplemented). This is unlikely, of course, but is possible (IE already throws errors for [[Get]] on some objects) and would be pretty disturbing : )

There was also a discussion on ES4 mailing list regarding requirements for host objects' [[Class]] values (in ES3.1). Perhaps that discussion could shed more light on whether we could/should use it.

[1] http://github.com/kangax/protolicious/tree/master/experimental/__getClass.js</body>
      <body-html>&lt;div&gt;&lt;p&gt;Tobie,&lt;/p&gt;
&lt;p&gt;I remember host objects yielding pretty strange values in some
of the browsers : ) You can see some of them in comments of the
original &lt;code&gt;__getClass&lt;/code&gt; &lt;a href=&quot;/projects/8886/changesets/1&quot; title=&quot;Changeset #1&quot;&gt;[1]&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I'm a bit worried about host objects throwing errors when asked
for [[Class]] (if it is, say, unimplemented). This is unlikely, of
course, but is possible (IE already throws errors for [[Get]] on
some objects) and would be pretty disturbing : )&lt;/p&gt;
&lt;p&gt;There was also a discussion on ES4 mailing list regarding
requirements for host objects' [[Class]] values (in ES3.1). Perhaps
that discussion could shed more light on whether we could/should
use it.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/8886/changesets/1&quot; title=&quot;Changeset #1&quot;&gt;[1]&lt;/a&gt; &lt;a href=&quot;http://github.com/kangax/protolicious/tree/master/experimental/__getClass.js&quot;&gt;
http://github.com/kangax/protoli...&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-01-07T02:46:33+01:00</created-at>
      <creator-id type="integer">16084</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">443</number>
      <permalink>objectisdate-method</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8886</project-id>
      <state>enhancement</state>
      <tag>needs_patch needs_tests</tag>
      <title>Object.isDate method</title>
      <updated-at type="datetime">2009-01-07T02:47:51+01:00</updated-at>
      <user-id type="integer">15559</user-id>
      <user-name>Juriy Zaytsev</user-name>
      <creator-name>Nesterenko Dmitry</creator-name>
      <url>http://prototype.lighthouseapp.com/projects/8886/tickets/443</url>
      <milestone-title nil="true"></milestone-title>
      <assigned-user-name>Tobie Langel</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">14168</assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>Another batch (mostly *nix this time) - all good to go : )

* Camino 1.6.6
* SeaMonkey 1.1.14
* Flock 2.0.2
* Galeon 2.0.6
* Epiphany 2.22
* Konqueror 4.1.2
* Arora 0.4
* OmniWeb 622.3.0.105198</body>
      <body-html>&lt;div&gt;&lt;p&gt;Another batch (mostly *nix this time) - all good to go : )&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Camino 1.6.6&lt;/li&gt;
&lt;li&gt;SeaMonkey 1.1.14&lt;/li&gt;
&lt;li&gt;Flock 2.0.2&lt;/li&gt;
&lt;li&gt;Galeon 2.0.6&lt;/li&gt;
&lt;li&gt;Epiphany 2.22&lt;/li&gt;
&lt;li&gt;Konqueror 4.1.2&lt;/li&gt;
&lt;li&gt;Arora 0.4&lt;/li&gt;
&lt;li&gt;OmniWeb 622.3.0.105198&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-01-07T03:05:09+01:00</created-at>
      <creator-id type="integer">16084</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">443</number>
      <permalink>objectisdate-method</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8886</project-id>
      <state>enhancement</state>
      <tag>needs_patch needs_tests</tag>
      <title>Object.isDate method</title>
      <updated-at type="datetime">2009-01-07T03:05:10+01:00</updated-at>
      <user-id type="integer">15559</user-id>
      <user-name>Juriy Zaytsev</user-name>
      <creator-name>Nesterenko Dmitry</creator-name>
      <url>http://prototype.lighthouseapp.com/projects/8886/tickets/443</url>
      <milestone-title nil="true"></milestone-title>
      <assigned-user-name>Tobie Langel</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">14168</assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>Here is a patch implementing `Object.isDate` using `getClass`, with documentation and corresponding unit tests.</body>
      <body-html>&lt;div&gt;&lt;p&gt;Here is a patch implementing &lt;code&gt;Object.isDate&lt;/code&gt; using
&lt;code&gt;getClass&lt;/code&gt;, with documentation and corresponding unit
tests.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-02-25T00:34:49+01:00</created-at>
      <creator-id type="integer">16084</creator-id>
      <diffable-attributes type="yaml">--- 
:tag: needs_patch needs_tests
</diffable-attributes>
      <milestone-id type="integer" nil="true"></milestone-id>
      <number type="integer">443</number>
      <permalink>objectisdate-method</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8886</project-id>
      <state>enhancement</state>
      <tag>patched tested</tag>
      <title>Object.isDate method</title>
      <updated-at type="datetime">2009-02-25T00:34:52+01:00</updated-at>
      <user-id type="integer">17913</user-id>
      <user-name>Samuel Lebeau</user-name>
      <creator-name>Nesterenko Dmitry</creator-name>
      <url>http://prototype.lighthouseapp.com/projects/8886/tickets/443</url>
      <milestone-title nil="true"></milestone-title>
      <assigned-user-name>Tobie Langel</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer">14168</assigned-user-id>
      <attachments-count type="integer">2</attachments-count>
      <body>Samuel, thanks, looks good. The only thing is that in documentation, &quot;Returns `true` if `object` is an instance of the [[Date]] class&quot; is a bit misleading. 

There are really no instances of [[Date]] class. Rather, there are objects with internal [[Class]] property having a value of &quot;Date&quot; : ) In other words, those are native `Date` objects created (explicitly or implicitly) with a native `Date` constructor (in any DOM context).

I would also be in favor of avoiding an extra function call in `Object.is*` methods (for perf. reasons) 

Maybe replace it with a simple string comparison?

@@@ javascript
(function(){
  var _toString = Object.prototype.toString;
  ...
  function isDate(o) {
    return _toString.call(o) === '[object Date]';
  }
  ...
  Object.isDate = isDate;
})();
@@@

Marking as 1.6.1</body>
      <body-html>&lt;div&gt;&lt;p&gt;Samuel, thanks, looks good. The only thing is that in
documentation, &quot;Returns &lt;code&gt;true&lt;/code&gt; if &lt;code&gt;object&lt;/code&gt; is
an instance of the [[Date]] class&quot; is a bit misleading.&lt;/p&gt;
&lt;p&gt;There are really no instances of [[Date]] class. Rather, there
are objects with internal [[Class]] property having a value of
&quot;Date&quot; : ) In other words, those are native &lt;code&gt;Date&lt;/code&gt;
objects created (explicitly or implicitly) with a native
&lt;code&gt;Date&lt;/code&gt; constructor (in any DOM context).&lt;/p&gt;
&lt;p&gt;I would also be in favor of avoiding an extra function call in
&lt;code&gt;Object.is*&lt;/code&gt; methods (for perf. reasons)&lt;/p&gt;
&lt;p&gt;Maybe replace it with a simple string comparison?&lt;/p&gt;


&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;
(function(){
  var _toString = Object.prototype.toString;
  ...
  function isDate(o) {
    return _toString.call(o) === '[object Date]';
  }
  ...
  Object.isDate = isDate;
})();
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Marking as 1.6.1&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-02-25T02:06:17+01:00</created-at>
      <creator-id type="integer">16084</creator-id>
      <diffable-attributes type="yaml">--- 
:milestone: 
</diffable-attributes>
      <milestone-id type="integer">9616</milestone-id>
      <number type="integer">443</number>
      <permalink>objectisdate-method</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8886</project-id>
      <state>enhancement</state>
      <tag>patched tested</tag>
      <title>Object.isDate method</title>
      <updated-at type="datetime">2009-02-25T02:06:22+01:00</updated-at>
      <user-id type="integer">15559</user-id>
      <user-name>Juriy Zaytsev</user-name>
      <creator-name>Nesterenko Dmitry</creator-name>
      <url>http://prototype.lighthouseapp.com/projects/8886/tickets/443</url>
      <milestone-title>1.7</milestone-title>
      <assigned-user-name>Tobie Langel</assigned-user-name>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">2</attachments-count>
      <body>[responsible:none bulk edit command]</body>
      <body-html>&lt;div&gt;&lt;p&gt;[responsible:none bulk edit command]&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2009-11-16T16:50:18+01:00</created-at>
      <creator-id type="integer">16084</creator-id>
      <diffable-attributes type="yaml">--- 
:tag: patched tested
:assigned_user: 14168
</diffable-attributes>
      <milestone-id type="integer">9616</milestone-id>
      <number type="integer">443</number>
      <permalink>objectisdate-method</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8886</project-id>
      <state>enhancement</state>
      <tag>patched</tag>
      <title>Object.isDate method</title>
      <updated-at type="datetime">2009-11-16T16:50:18+01:00</updated-at>
      <user-id type="integer">32948</user-id>
      <user-name>T.J. Crowder</user-name>
      <creator-name>Nesterenko Dmitry</creator-name>
      <url>http://prototype.lighthouseapp.com/projects/8886/tickets/443</url>
      <milestone-title>1.7</milestone-title>
      <assigned-user-name nil="true"></assigned-user-name>
    </version>
  </versions>
  <attachments type="array">
    <attachment type="Attachment">
      <code>f75317c2394544dc95abe433e4c36f62db17cf7a</code>
      <content-type>text/javascript</content-type>
      <created-at type="datetime">2008-12-24T18:33:15+01:00</created-at>
      <filename>isDate.js</filename>
      <height type="integer" nil="true"></height>
      <id type="integer">73800</id>
      <size type="integer">505</size>
      <uploader-id type="integer">15559</uploader-id>
      <width type="integer" nil="true"></width>
      <url>http://prototype.lighthouseapp.com/attachments/73800/isDate.js</url>
    </attachment>
    <attachment type="Attachment">
      <code>706bf39bee3c4e4e862b36c0bfc305443882b08b</code>
      <content-type>text/plain</content-type>
      <created-at type="datetime">2009-02-25T00:34:49+01:00</created-at>
      <filename>object_isDate.patch</filename>
      <height type="integer" nil="true"></height>
      <id type="integer">92581</id>
      <size type="integer">1515</size>
      <uploader-id type="integer">17913</uploader-id>
      <width type="integer" nil="true"></width>
      <url>http://prototype.lighthouseapp.com/attachments/92581/object_isDate.patch</url>
    </attachment>
  </attachments>
</ticket>
