W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2008

Re: [WebIDL] Assigning to constants

From: Cameron McCormack <cam@mcc.id.au>
Date: Tue, 17 Jun 2008 09:38:52 +1000
To: public-webapps@w3.org
Message-ID: <20080616233852.GA32468@arc.mcc.id.au>

Simon Pieters:
> Thanks.
>
> I'm not sure what the implications are, though; are they also readonly in 
> the following cases?
>
>    Node.prototype.ELEMENT_NODE = 'Hello world';
>    Element.prototype.ELEMENT_NODE = 'Hello world';
>    document.documentElement.ELEMENT_NODE = 'Hello world';

Yes.  The properties set for IDL consts on the interface object, the
interface prototype object (or corresponding exception ones) should all
be ReadOnly.  (And the prototype is where the constant comes from in the
document.documentElement.ELEMENT_NODE case.)

-- 
Cameron McCormack ≝ http://mcc.id.au/
Received on Monday, 16 June 2008 23:39:36 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:25 GMT