Merge pull request #11124 from meteor/socket-stream-invalid-state-err

This commit is contained in:
Filipe Névola
2020-07-17 16:10:18 -04:00
committed by GitHub
2 changed files with 11 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
Package.describe({
name: "socket-stream-client",
version: "0.3.0",
version: "0.3.1",
summary: "Provides the ClientStream abstraction used by ddp-client",
documentation: "README.md"
});

View File

@@ -298,6 +298,12 @@ utils.log = function() {
}
};
utils.debug = function() {
if (_window.console && console.debug && console.debug.apply) {
console.debug.apply(console, arguments);
}
};
utils.bind = function(fun, that) {
if (fun.bind) {
return fun.bind(that);
@@ -1083,8 +1089,10 @@ SockJS.prototype._didClose = function(code, reason, force) {
var that = this;
if (that.readyState !== SockJS.CONNECTING &&
that.readyState !== SockJS.OPEN &&
that.readyState !== SockJS.CLOSING)
throw new Error('INVALID_STATE_ERR');
that.readyState !== SockJS.CLOSING) {
utils.debug('INVALID_STATE_ERR', that.readyState);
return;
}
if (that._ir) {
that._ir.nuke();
that._ir = null;