W3C home > Mailing lists > Public > public-script-coord@w3.org > July to September 2013

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

From: <bugzilla@jessica.w3.org>
Date: Thu, 01 Aug 2013 00:07:28 +0000
To: public-script-coord@w3.org
Message-ID: <bug-20567-3890-NZNr5c0NCA@http.www.w3.org/Bugs/Public/>
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

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:37:50 UTC