Detecting the "type" of a DOM object
allen at wirfs-brock.com
Mon Jun 25 08:49:05 PDT 2012
On Jun 24, 2012, at 5:51 AM, Brendan Eich wrote:
> David Bruant wrote:
>> Instead of adding a new [[instanceofHint]] internal property, maybe the
>> [[NativeBrand]] could be reused.
> +1 on that, which suggests [[NativeBrandMatch]] instead of [[InstanceofMatch]].
No, the whole point of transitioning from [[Class]] to [[NativeBrand]] was to ensure that [[NativeBrand]] was a closed ended, non-extensible set of specification internal nominal type tags that are used within the ES specification primarily to specify various legacy behaviors (certain built-in methods only work on specific built-in objects, etc.)
Making [[NativeBrand]] extensible would be exactly equivalent to the current [[Class]] and would have the same issues. For example, it conflates default toString behavior with the internal nominal types.
Rather than immediately jumping to over loading existing extension points It would be better to first identify and work out in detail all the extension points that we actually need. After we have done this, would be the right time to go back and see if any of them can be merged.
More information about the es-discuss