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

Re: [WebIDL] Assigning to constants

From: Magnus Kristiansen <magnusrk+w3c@pvv.org>
Date: Tue, 17 Jun 2008 08:45:52 +0200
Message-ID: <48575DA0.9030708@pvv.org>
To: public-webapps@w3.org

Cameron McCormack wrote:
> 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.)

The last case isn't covered at the moment, since s14 of [[Put]] goes to 
s24, skipping [[CanPut]] (which is the step that checks prototype chain 
for readonly). It should instead go to s19. However, at that point it's 
just doing what would happen at s15, so s14 can actually be removed.

And two more issues I noticed:
- Using an IndexSetter results in a return value (s7), the other returns 
are void. Copypaste from [[Get]] maybe?
- [[HasProperty]] = true (s9-10) should go to s15, since s14 is 
trivially false. This solves itself if s14 is removed per above.

-- 
Magnus Kristiansen
"Don't worry; the Universe IS out to get you."
Received on Tuesday, 17 June 2008 06:47:34 GMT

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