var _global = (function() { return this; })();
var NativeWebSocket = _global.WebSocket || _global.MozWebSocket;
var websocket_version = require('./version');


/**
 * Expose a W3C WebSocket class with just one or two arguments.
 */
function W3CWebSocket(uri, protocols) {
	var native_instance;

	if (protocols) {
		native_instance = new NativeWebSocket(uri, protocols);
	}
	else {
		native_instance = new NativeWebSocket(uri);
	}

	/**
	 * 'native_instance' is an instance of nativeWebSocket (the browser's WebSocket
	 * class). Since it is an Object it will be returned as it is when creating an
	 * instance of W3CWebSocket via 'new W3CWebSocket()'.
	 *
	 * ECMAScript 5: http://bclary.com/2004/11/07/#a-13.2.2
	 */
	return native_instance;
}


/**
 * Module exports.
 */
module.exports = {
    'w3cwebsocket' : NativeWebSocket ? W3CWebSocket : null,
    'version'      : websocket_version
};

@@ -738,16 +738,220 @@
 ance;%0A%7D%0A
+if (NativeWebSocket) %7B%0A%09%5B%22CONNECTING%22, %22OPEN%22, %22CLOSING%22, %22CLOSED%22%5D.forEach(function(prop) %7B%0A%09%09Object.defineProperty(W3CWebSocket, prop, %7B%0A%09%09%09get: function() %7B return NativeWebSocket%5Bprop%5D; %7D%0A%09%09%7D);%0A%09%7D);%0A%7D
 %0A%0A/**%0A *

add readyState constants to browser `w3cwebsocket`