Re: [webidl] definition of const string literal

"Anne van Kesteren" <annevk@opera.com> writes:

> On Mon, 27 Apr 2009 15:56:42 +0200, Max Froumentin <maxfro@opera.com>
> wrote:
>> The grammar in http://dev.w3.org/2006/webapi/WebIDL/ prevents
>> declarations such as:
>>
>> const DOMString foo = "bar";
>>
>> because the "ConstExp" rule [1] only allows a number, or "TRUE" or
>> "FALSE". Is it an omission?
>
> What is the use case? Web APIs usually work with numbers (if they have
> constants at all).

I was wondering that too. But if there are no use cases, then the spec should be changed to
disallow "const DOMString foo;". I'd disallow boolean too, in fact, but leave number constants.

Max.

Received on Monday, 27 April 2009 14:35:57 UTC