Re: Numeric constants vs enumerated strings

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.


-- 
Anne van Kesteren
http://annevankesteren.nl/

Received on Thursday, 16 February 2012 08:58:34 UTC