[whatwg] Websockets Client API

Bruce Atherton bruce at callenish.com
Sun Feb 20 17:39:27 PST 2011


Sorry, I don't understand what you mean. The constructor is not throwing 
an exception in this case. The issue I am concerned with is that the 
Websocket object can potentially be used before it has been configured 
with event handlers, although it sounds like that may not be an issue in 
browsers.

To my mind there are two solutions: include an event-handler collection 
as a parameter on all the constructor methods, or separate the open() 
call out from the constructor. For my library I think I'll opt for the 
latter option.

On 20/02/2011 4:28 PM, Anthony Papillion wrote:
> Forgive me if I'm overlooking something here but couldn't the same thing
> be accomplished by wrapping the constructor code in a try/catch block?
>
> Anthony
>




More information about the whatwg mailing list