Re: [DOM4] Remove Node.isSameNode

* Jonas Sicking wrote:
>It's a completely useless function. It just implements the equality
>operator. I believe most languages have a equality operator already.

It's quite normal for object models to not guarantee that "the" equality
operator works for object identity comparison, COM being a prime example
where this is only guaranteed for IUnknown pointers. Leading to issues
but that's life. It is also useful to have this as function available in
environments where "the object identity operator" is not available as a
function. In JavaScript, if function arity is ignored as is typical,

  [], node.isSameNode, node)

can be used to check whether a node is in a node list, the "equivalent"

  [], function(elem) { return elem === node; })

is a good bit worse if you want to use this as condition in an if block
as you would run past line length restrictions easily and would have to
put this on several lines. Using proxying wrappers is quite a common
practise so I do
not see why everybody should spend resources removing this method. It's
widely implemented, used, solve an actual problem, has a spec and test
cases, I am not aware of bugs in widely used implementations, if all DOM
methods were like that we'd all be rejoicing.
Björn Höhrmann · ·
Am Badedeich 7 · Telefon: +49(0)160/4415681 ·
25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · 

Received on Saturday, 10 September 2011 02:24:33 UTC