D
David Mark
David, then why isn't the function that simple?
The original discussion "When is a function not a function" concerned
a function of mine that could receive a Function or Object object as a
callback parameter. The specifics were that it would call a
predetermined method on Object objects. If a callable host object
(typeof(o) == 'function') is passed, which would be a violation of the
rules, it should not call it and therefore fail silently. This posted
version is the solution for that. It will not mistake callable host
objects (or builtin functions) for suitable callback Functions. It
will fail instantly if passed an inappropriate callback parameter.
Is it of any practical use? Not for me at this time as I don't handle
callbacks that way anymore. It did spark a lot of discussion in the
original thread though.
[snip]
I can see this point. I think David is suggesting he always knows that
the 'o' variable is at least declared and so the call to the wrapper
function will not error.
Exactly.