X-Git-Url: https://git.josue.xyz/?p=VSoRC%2F.git;a=blobdiff_plain;f=node_modules%2Fwebsocket%2Flib%2Fbrowser.js;fp=node_modules%2Fwebsocket%2Flib%2Fbrowser.js;h=0000000000000000000000000000000000000000;hp=51d1979207c677ffc0600deb10877808d1c2cdbf;hb=5e96dd57ddd883604e87f62bdddcb111c63a6e1a;hpb=acb5f682a2b75b972710cabd81658f63071324b0 diff --git a/node_modules/websocket/lib/browser.js b/node_modules/websocket/lib/browser.js deleted file mode 100644 index 51d1979..0000000 --- a/node_modules/websocket/lib/browser.js +++ /dev/null @@ -1,47 +0,0 @@ -var _global = (function () { - if (!this && typeof global !== 'undefined') { - return global; - } - 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; -} -if (NativeWebSocket) { - ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED'].forEach(function(prop) { - Object.defineProperty(W3CWebSocket, prop, { - get: function() { return NativeWebSocket[prop]; } - }); - }); -} - -/** - * Module exports. - */ -module.exports = { - 'w3cwebsocket' : NativeWebSocket ? W3CWebSocket : null, - 'version' : websocket_version -};