On Oct 10, 5:17 am, "Andrea Giammarchi" <[EMAIL PROTECTED]> wrote: > Kangax, > about __getClass(undefined) and __getClass(null), both return Window, that > seems ambiguous for me.
Well, it depends on what you need it (use it) for. I was simply curious to see what kind of value interpreter assigns to internal [[Class]] property. Those internal properties are usually not accessible (at least not in a subset of ECMA), so it was a fun exercise to read specs and find ways to reveal such information. > > __getClass = function(toString){return function(Object){ > return Object != null ? > toString.call(Object).match(/^\[object\s([^\]]+)\]$/)[1] : Object > > }}(Object.prototype.toString); > > Moreover, getClass is not a "perfect name", since the method return Object > with every instance that is not native, while cases like document.body or > others, could be browser dependent. Sorry, I lost you here. "Object with every instance that is not native"? What do you mean? > > Regards -- kangax [snip] --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to jquery-dev@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en -~----------~----~----~----~------~----~------~--~---