Not in ES5.  Generally checking that typeof x === 'function' is a close 
approximation. ES5 (11.4.3) requires that  both native (ie, pure actual 
ECMAScript objects) and host objects that implement [[Call]] produce "function" 
when typeof is applied to them.  This is a change from ES3 that did not impose 
this requirement upon host object objects.

Of course it may take a while for browser implementations to respond to this 
change.

Allen

>-----Original Message-----
>From: [email protected] [mailto:es-discuss-
>[email protected]] On Behalf Of Garrett Smith
>Sent: Friday, June 05, 2009 1:31 PM
>To: es-discuss
>Subject: Using IsCallable Operation?
>
>There seems to be a lot of controversy on how to properly check if
>something should be callable. There isn't any way to determine that in
>ES3.
>
>The internal IsCallable determines if an object has a [[Call]] property.
>
>Will that be available as a language feature, not internal?
>
>For example:-
>  Object.isCallable( document.images );
>
>- would provide a check to internal IsCallable and return the result.
>
>Garrett
>_______________________________________________
>es-discuss mailing list
>[email protected]
>https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to