Update baseURI checking/pull and fallback, fixes #17661

This commit fixes an issue in IE10 and IE11 (which do support WebSockets). The .baseURI is not valid in those browsers, so you have to have a more robust fallback and check. The fix below was authored and tested against an actual websocket supporting server and has been verified to work. I also spent some time and did AMD cleanup on the module, getting rid of dojox. dojo. and most deprecated API usage. It now no longer forcibly expects a dojox. namespace and such.
It was assumed before we would always have a document.baseURI, which turned
out not to be the case.  It's a final fallback check, just in case.

On Tue, Nov 4, 2014 at 11:38 AM, Ben Hockey <notifications@github.com>
wrote:

> In socket.js:
>
> >
> >  Socket.WebSocket = function(args, fallback){
> >  	// summary:
> >  	//		A wrapper for WebSocket, than handles standard args and relative URLs
> > -	var ws = new WebSocket(new dojo._Url(document.baseURI.replace(/^http/i,'ws'), args.url));
> > +	var baseURI = document.baseURI || window.location.href;
> > +	if(!baseURI){
>
> is it ever the case that we don't have a baseURI by this point? i'd
> rather not have this block here if we don't understand when we will ever
> get to it. i would expect that as long as we're in a browser then all we'll
> need is
>
> var baseURI = document.baseURI || window.location.href;var ws = new WebSocket(new dBaseUrl(baseURI.replace(/^http/i,'ws'), args.url));
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/dojo/dojox/pull/148/files#r19815339>.
>