+1 for the returned class ... also if we distinguish between "array" and "Array" then the new Boolean/Number/String case can be covered via "Number", if object, rather than "number", which is cool.
Th only weird thing would be "object" rather than "Object", as if its [[class]] is unknown br On Fri, Jan 20, 2012 at 5:39 AM, Axel Rauschmayer <a...@rauschma.de> wrote: > > So Object.type is the thing to draft. Probably it should return > typeof-like strings with the "null" fix and only that. I do not believe it > should start returning "array" for Array instances, or take other > experimental risks. But we should discuss. > > FWIW: I’ve written down all typeof use cases that I could come up with: > http://www.2ality.com/2012/01/typeof-use-cases.html > > A way of returning [[class]] would be great. Any reason why such a > function couldn’t be merged with Object.type()? My attempt at implementing > such a merged function (along with a detailed rationale – I prefer > returning "Array" to returning "array") is documented here: > http://www.2ality.com/2011/11/improving-typeof.html > > -- > Dr. Axel Rauschmayer > a...@rauschma.de > > home: rauschma.de > twitter: twitter.com/rauschma > blog: 2ality.com > >
_______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss