« Return to Thread: Using IsCallable Operation?

Re: Using IsCallable Operation?

by Mark S. Miller-2 :: Rate this Message:

Reply to Author | View in Thread

On Fri, Jun 5, 2009 at 1:39 PM, Allen Wirfs-Brock
<Allen.Wirfs-Brock@...> wrote:
> 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.

Why is this an approximation? In ES5, how can
    typeof x === 'function'
differ from testing whether something is callable?

--
    Cheers,
    --MarkM
_______________________________________________
es-discuss mailing list
es-discuss@...
https://mail.mozilla.org/listinfo/es-discuss

 « Return to Thread: Using IsCallable Operation?