W3C home > Mailing lists > Public > public-webrtc@w3.org > February 2012

Re: Numeric constants vs enumerated strings

From: Philip Jägenstedt <philipj@opera.com>
Date: Thu, 16 Feb 2012 20:35:41 +0100
To: public-webrtc@w3.org
Message-ID: <op.v9sd1rq9sr6mfa@kirk>
On Thu, 16 Feb 2012 09:57:54 +0100, Anne van Kesteren <annevk@opera.com>  
wrote:

> On Thu, 16 Feb 2012 08:58:05 +0100, Philip Jägenstedt  
> <philipj@opera.com> wrote:
>> Can't we have our cake and eat it too? If we really want to favor  
>> consistency on the scripting side (not implementation), we could let  
>> HTMLMediaElement.readyState and XMLHttpRequest.readyState return magic  
>> objects that compare true both to their string and their numeric  
>> constants. It might have to toString to the number, though...
>
> That sounds somewhat messy.
>
> In any event, Document.readyState already returns a string (and not even  
> because we designed it that way, because it so happened to be in  
> Microsoft's implementation), so the inconsistency is already there.

OK, in that case it sounds fine to just have a property called  
"readyState" and let it return strings, as renaming it to just "state"  
wouldn't actually help consistency.

-- 
Philip Jägenstedt
Core Developer
Opera Software
Received on Thursday, 16 February 2012 19:36:09 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 15:19:27 UTC