W3C home > Mailing lists > Public > public-script-coord@w3.org > April to June 2011

[Bug 12845] Disallow shadowing attributes

From: <bugzilla@jessica.w3.org>
Date: Wed, 08 Jun 2011 05:13:27 +0000
To: public-script-coord@w3.org
Message-Id: <E1QUB55-0006oN-Dd@jessica.w3.org>

--- Comment #22 from Boris Zbarsky <bzbarsky@mit.edu> 2011-06-08 05:13:25 UTC ---
> you may expediently make the immutable version a sublass of the mutable version
> and over-ride all the mutation method to throw an error

That's not a workable solution for a web spec, because you can explicitly call
the "superclass" methods on the "subclass" instance (just grab them off the
higher-up-the-chain proto and use .call()).

> Adding write behavior is a specialization which is valid subtyping behavior.

I agree; I would be quite happy with explicit WebIDL syntax for this, as I

> The second issue is how does this map to JS

That's a solvable problem; it doesn't matter to me that much how exactly we
solve it.

> The problem is with *incompatible* behaviour, right? 

_A_ problem is when two prototypes on the proto chain of an element, say, both
define a property and the two property getters do different things when called
on that element.  In particular it breaks grabbing a property off the higher-up
prototype and then applying its getter to all things that have that proto on
the proto chain... unless that operation somehow makes sense for this element
which has some other getter definition lower down on its proto chain.

I'm not sure I can think of an example of "different but compatible" behavior
that doesn't run into that problem.  Can you?

Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
Received on Wednesday, 8 June 2011 05:13:28 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:03 UTC