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

Re: [WebIDL] Assigning to constants

From: Simon Pieters <simonp@opera.com>
Date: Fri, 13 Jun 2008 13:52:11 +0200
To: "Andrew Oakley" <andrew@ado.is-a-geek.net>
Cc: public-webapps@w3.org
Message-ID: <op.ucoq89qgidj3kv@zcorpandell.linkoping.osa>

On Thu, 12 Jun 2008 21:03:31 +0200, Andrew Oakley  
<andrew@ado.is-a-geek.net> wrote:

> Simon Pieters wrote:
>>  What should happen when you assign something to a constant? e.g.:
>>     Node.ELEMENT_NODE = 'Hello world';
>>  Web IDL doesn't say, AFAICT. Firefox and Opera allow the assignment.  
>> In WebKit it silently fails. I had expected an exception to be thrown,  
>> just like for readonly attributes.
>>  It'd be good if this was defined.
> http://dev.w3.org/2006/webapi/Binding4DOM/#es-constants says the  
> property has attributes { DontDelete }.  That would imply that it  
> doesn't have the ReadOnly attribute, and as such the assignment should  
> be allowed.

Ok, good that it is defined.

But is there a good reason why it is this way rather than what I'd  
expected (same as readonly attributes)? I think authors should be able to  
rely on constants being, um, constant. No?

Simon Pieters
Opera Software
Received on Friday, 13 June 2008 11:52:54 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:09 UTC