<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: isFunction() or isObject(), that is the question ?</title>
	<atom:link href="http://dbj.org/dbj/?feed=rss2&#038;p=286" rel="self" type="application/rss+xml" />
	<link>http://dbj.org/dbj/?p=286</link>
	<description>Creative Disruptive Feasible</description>
	<lastBuildDate>Mon, 23 Aug 2010 07:43:51 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: 修复 jQuery 中 isFunction 方法的 BUG - 隐遁峰</title>
		<link>http://dbj.org/dbj/?p=286&#038;cpage=1#comment-610</link>
		<dc:creator>修复 jQuery 中 isFunction 方法的 BUG - 隐遁峰</dc:creator>
		<pubDate>Fri, 04 Jun 2010 02:29:37 +0000</pubDate>
		<guid isPermaLink="false">http://dbj.org/dbj/?p=286#comment-610</guid>
		<description>[...] 《isFunction() or isObject(), that is the question ? 》 [...]</description>
		<content:encoded><![CDATA[<p>[...] 《isFunction() or isObject(), that is the question ? 》 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 修复 jQuery 中 isFunction 方法的 BUG ｜ 前端开发吧</title>
		<link>http://dbj.org/dbj/?p=286&#038;cpage=1#comment-523</link>
		<dc:creator>修复 jQuery 中 isFunction 方法的 BUG ｜ 前端开发吧</dc:creator>
		<pubDate>Wed, 28 Apr 2010 01:34:12 +0000</pubDate>
		<guid isPermaLink="false">http://dbj.org/dbj/?p=286#comment-523</guid>
		<description>[...] 《isFunction() or isObject(), that is the question ? 》 [...]</description>
		<content:encoded><![CDATA[<p>[...] 《isFunction() or isObject(), that is the question ? 》 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 修复jQuery中isFunction方法的BUG &#124; My Sky</title>
		<link>http://dbj.org/dbj/?p=286&#038;cpage=1#comment-461</link>
		<dc:creator>修复jQuery中isFunction方法的BUG &#124; My Sky</dc:creator>
		<pubDate>Mon, 12 Apr 2010 15:25:55 +0000</pubDate>
		<guid isPermaLink="false">http://dbj.org/dbj/?p=286#comment-461</guid>
		<description>[...] 《isFunction() or isObject(), that is the question ? 》 [...]</description>
		<content:encoded><![CDATA[<p>[...] 《isFunction() or isObject(), that is the question ? 》 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dusan</title>
		<link>http://dbj.org/dbj/?p=286&#038;cpage=1#comment-81</link>
		<dc:creator>Dusan</dc:creator>
		<pubDate>Mon, 10 Aug 2009 09:42:40 +0000</pubDate>
		<guid isPermaLink="false">http://dbj.org/dbj/?p=286#comment-81</guid>
		<description>There is a solution , which *should* work &quot;everywhere, and which fails on *only* one singularity.
There is only one &quot;bomb&quot; which is hardly possible in reality, unless someone &quot;plants&quot; it deliberately. For *every* other case this simple function bellow should work.
&lt;pre&gt;&lt;code&gt;
var bomb = { toString : undefined, valueOf: function(o) {return &quot;function BOMBA!&quot;; }} ;
// V.5    --- almost perfect ?
function isF ( f ) { 
   try {  return /^\s*\bfunction\b/.test(f) ;
   } catch (x) {   return false ;
   }
}

isF(bomb)
/*
true  -- not OK
*/
isF(alert)
/*
true  -- OK
*/
isF( isF )
/*
true -- OK
*/
&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>There is a solution , which *should* work &#8220;everywhere, and which fails on *only* one singularity.<br />
There is only one &#8220;bomb&#8221; which is hardly possible in reality, unless someone &#8220;plants&#8221; it deliberately. For *every* other case this simple function bellow should work.</p>
<pre><code>
var bomb = { toString : undefined, valueOf: function(o) {return "function BOMBA!"; }} ;
// V.5    --- almost perfect ?
function isF ( f ) {
   try {  return /^\s*\bfunction\b/.test(f) ;
   } catch (x) {   return false ;
   }
}

isF(bomb)
/*
true  -- not OK
*/
isF(alert)
/*
true  -- OK
*/
isF( isF )
/*
true -- OK
*/
</code></pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dusan</title>
		<link>http://dbj.org/dbj/?p=286&#038;cpage=1#comment-79</link>
		<dc:creator>Dusan</dc:creator>
		<pubDate>Mon, 10 Aug 2009 09:17:15 +0000</pubDate>
		<guid isPermaLink="false">http://dbj.org/dbj/?p=286#comment-79</guid>
		<description>Sorry Andrea, but your &quot;solution&quot; will not work with this argument :
&lt;pre&gt;&lt;code&gt;
isIENativeFunction(
{ toString : undefined, valueOf : function () { return &quot;function X&quot;;} }
)
/*
returns: true
*/
&lt;/code&gt;&lt;/pre&gt;
And it will throw an exception in this case :
&lt;pre&gt;&lt;code&gt;
isIENativeFunction({ toString : undefined })
/*
TypeError 
Number : 438
Description : Object doesn&#039;t support this property or method
*/
&lt;/code&gt;&lt;/pre&gt;
Etc ... I am sure, by now, you have spoted the flaw in your logic. But thanks for your comment, anyway.</description>
		<content:encoded><![CDATA[<p>Sorry Andrea, but your &#8220;solution&#8221; will not work with this argument :</p>
<pre><code>
isIENativeFunction(
{ toString : undefined, valueOf : function () { return "function X";} }
)
/*
returns: true
*/
</code></pre>
<p>And it will throw an exception in this case :</p>
<pre><code>
isIENativeFunction({ toString : undefined })
/*
TypeError
Number : 438
Description : Object doesn't support this property or method
*/
</code></pre>
<p>Etc &#8230; I am sure, by now, you have spoted the flaw in your logic. But thanks for your comment, anyway.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
