simple-websocket
Advanced tools
Comparing version 5.0.1 to 5.0.2
18
index.js
@@ -71,3 +71,3 @@ /* global WebSocket */ | ||
process.nextTick(function () { | ||
self._onError(err) | ||
self._destroy(err) | ||
}) | ||
@@ -89,3 +89,3 @@ return | ||
self._ws.onerror = function () { | ||
self._onError(new Error('connection error to ' + self.url)) | ||
self._destroy(new Error('connection error to ' + self.url)) | ||
} | ||
@@ -118,3 +118,3 @@ | ||
self._debug('destroy (error: %s)', err && err.message) | ||
self._debug('destroy (error: %s)', err && (err.message || err)) | ||
@@ -171,3 +171,3 @@ self.readable = self.writable = false | ||
} catch (err) { | ||
return this._onError(err) | ||
return this._destroy(err) | ||
} | ||
@@ -204,3 +204,3 @@ if (typeof ws !== 'function' && this._ws.bufferedAmount > MAX_BUFFERED_AMOUNT) { | ||
self._destroy() | ||
}, 100) | ||
}, 1000) | ||
} | ||
@@ -225,3 +225,3 @@ } | ||
} catch (err) { | ||
return self._onError(err) | ||
return self._destroy(err) | ||
} | ||
@@ -265,8 +265,2 @@ self._chunk = null | ||
Socket.prototype._onError = function (err) { | ||
if (this.destroyed) return | ||
this._debug('error: %s', err.message || err) | ||
this._destroy(err) | ||
} | ||
Socket.prototype._debug = function () { | ||
@@ -273,0 +267,0 @@ var args = [].slice.call(arguments) |
{ | ||
"name": "simple-websocket", | ||
"description": "Simple, EventEmitter API for WebSockets (browser)", | ||
"version": "5.0.1", | ||
"version": "5.0.2", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Feross Aboukhadijeh", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
90345
831