[Bug 20567] Change [[Prototype]] for concept-node-adopt?

https://www.w3.org/Bugs/Public/show_bug.cgi?id=20567

--- Comment #25 from Jonas Sicking <jonas@sicking.cc> ---
I personally don't think it's at all easy to understand the concept of changing
JS object identity.

It leads to all sorts of surprising and complicated issues.

Even the fact that you can have to JS objects that refer to the same underlying
object is very complicated. We used to have that setup in our chrome code and
it created lots of hard-to-understand situations for developers.

Basically any time you have code like "x == y" you are at risk of having a bug.
We'd even have to bring back the Node.isSameNode(Node) function from DOM Core
L3 in order to give people an opportunity to fix such code. But obviously most
people will forget that the == operator no longer works.

In fact, we have the same issue in our C++ code since we can end up with
objects having multiple implementations of the same interface. We very strongly
try to avoid getting into that situation because it's really scary to have the
'==' operator not working and to rely on that people use a function to check
whether two objects are the same one.

I agree that the fact that some properties change and others don't is also
confusing. Though in most cases properties will be replaced by new ones that
have exactly the same name and behavior, so in most cases it is transparent.

And as far I can know we haven't had anyone actually complain about this
happening in Gecko.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Received on Thursday, 1 August 2013 00:07:30 UTC