This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Numeric constants sucks when used in javascript. Code like if (es.readyState == EventSource.CONNECTING) { ... } is both harder to read and harder to type compared to if (es.readyState == "connecting") { ... } All the uppercase letters are a pain to type and and stick out like a sore thumb. Additionally there's a very real risk that people will write code like if (ws.readyState == 0) { ... } since '0' is so much easier to write than 'EventSource.CONNECTING'. It's even likely that comparing to a string is faster than comparing to EventSource.CONNECTING since the latter involves a property lookup.
While I agree with the design principle, I think it's not a big enough win to be worth the churn here. People complain all the time that we keep changing things — we should only do it when we have a truly compelling reason (e.g. a security problem). In practice, little non-debug code will likely end up using eventsource.readyState anyway. It's easier to use the events. It was mostly added for consistency with XMLHttpRequest, which also uses numbers — and people don't generally find it onerous to remember which readyState is which for that API.