[[Class]] and host objects
Allen.Wirfs-Brock at microsoft.com
Mon Feb 9 21:00:41 PST 2009
>From: Waldemar Horwat [mailto:waldemar at google.com]
>Sent: Monday, February 09, 2009 6:30 PM
>As you guys mentioned, the bigger question is what to do about multiple
>global objects. That's the issue in reality and we shouldn't add
>anything to the spec that would be inconsistent with that reality.
I'm inclination is say that we should explicitly specify for each [[Class]] value used in the specification only and exactly the invariants that something in the specification actually depends upon. Anything else seems to be outside the scope of the specification and there is no good way so select which of the Section 15 characteristics do or don't need to be specified.
Other than toString I believe that the only directly user observable use of [[Class]] is the new Array.isArray function. The main use case for this was Doug's JSON libraries that needed to determine which objects should be output using array literal notation. We now have enough reflection support that he could write any sort of Array litmus test that he thought was appropriate (for example, length property value == largest numeric property name + 1). Given that, maybe we don't really need Array.isArrary which would probably simply the what does [[Class]]=="Array" mean discussion.
More information about the Es-discuss