Re: [WebIDL] Assigning to constants

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 UTC