OMG, I can confirm this, on IE6 anyway.  (Couldn't they get *anything*
right?  I mean, I know Firefox has its issues, but...  And yes,
technically a function is an object, but that's no excuse.)

The only workaround that immediately comes to mind is to actually have
a list of these and compare against them in IE -- e.g.:

isFunction: (function(){
    if (typeof window.close == "object") {
        // IE version, works around typeof returning "object" for
intrinsic functions
        return function(object) {
            return (
                typeof object == "function"
                || object === window.close
                || object === document.getElementById
                // etc., etc., etc.
            );
        };
    } else {
        // Non-IE version, expects typeof to work correctly
        return function(object) {
            return typeof object == "function";
        };
    }
})()

Blech.  The more of this that happens, the more I want a separate file
that only IE people have to download containing these workarounds...
--
T.J. Crowder
tj / crowder software / com

On Jun 6, 9:27 am, Viktor Kojouharov <[EMAIL PROTECTED]> wrote:
> Here's quite the problem in IE.
>
> For certain 'native' functions, like window.close, or
> document.getElementById, typeof for those functions returns on object
> in IE. Consequently, Object.isFunction will actually return false for
> those functions.
>
> Though there's probably little that can be done, I thought you guys
> should know about it.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to