On Oct 9, 2:33 pm, Nathan Hammond <[EMAIL PROTECTED]> wrote:
> This showed up on Douglas Crockford's blog today:
> Object.prototype.toString.apply(value) === '[object Array]'
>
> The trick appears to have been in circulation for about 6 months and
> shows up in DWR as well as DC's book. DC credits Mark Miller for it.
> Probably slower than the value.constructor == Array test we use
> everywhere, but fixes the iframe-created object issue.
>
> 1. Should we adopt it for resiliency?
> 2. @Michael Geary: Are you using this in your iframe sandbox code? It
> sure would beat the heck out of duck typing.
>
> Just starting a discussion...

Object.prototype.toString returns an internal [[Class]] property.
I've been playing with this some time ago:

http://github.com/kangax/protolicious/tree/master/experimental/__getClass.js

> Nathan

--
kangax
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to