Skip to content

Commit

Permalink
4.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pubkey committed Feb 3, 2022
1 parent 1a3c56d commit 7f36d56
Show file tree
Hide file tree
Showing 13 changed files with 117 additions and 128 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

## X.X.X (comming soon)

## 4.10.0 (3 February 2022)

- Improve error message when calling `postMessage` to a closed channel.

## 4.9.0 (23 December 2021)
Expand Down
8 changes: 7 additions & 1 deletion dist/es5node/broadcast-channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,13 @@ function enforceOptions(options) {
BroadcastChannel.prototype = {
postMessage: function postMessage(msg) {
if (this.closed) {
throw new Error('BroadcastChannel.postMessage(): ' + 'Cannot post message after channel has closed');
throw new Error('BroadcastChannel.postMessage(): ' + 'Cannot post message after channel has closed ' +
/**
* In the past when this error appeared, it was realy hard to debug.
* So now we log the msg together with the error so it at least
* gives some clue about where in your application this happens.
*/
JSON.stringify(msg));
}

return _post(this, 'message', msg);
Expand Down
8 changes: 7 additions & 1 deletion dist/esbrowser/broadcast-channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,13 @@ export function enforceOptions(options) {
BroadcastChannel.prototype = {
postMessage: function postMessage(msg) {
if (this.closed) {
throw new Error('BroadcastChannel.postMessage(): ' + 'Cannot post message after channel has closed');
throw new Error('BroadcastChannel.postMessage(): ' + 'Cannot post message after channel has closed ' +
/**
* In the past when this error appeared, it was realy hard to debug.
* So now we log the msg together with the error so it at least
* gives some clue about where in your application this happens.
*/
JSON.stringify(msg));
}

return _post(this, 'message', msg);
Expand Down
8 changes: 7 additions & 1 deletion dist/esnode/broadcast-channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,13 @@ export function enforceOptions(options) {
BroadcastChannel.prototype = {
postMessage: function postMessage(msg) {
if (this.closed) {
throw new Error('BroadcastChannel.postMessage(): ' + 'Cannot post message after channel has closed');
throw new Error('BroadcastChannel.postMessage(): ' + 'Cannot post message after channel has closed ' +
/**
* In the past when this error appeared, it was realy hard to debug.
* So now we log the msg together with the error so it at least
* gives some clue about where in your application this happens.
*/
JSON.stringify(msg));
}

return _post(this, 'message', msg);
Expand Down
8 changes: 7 additions & 1 deletion dist/lib/broadcast-channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,13 @@ function enforceOptions(options) {
BroadcastChannel.prototype = {
postMessage: function postMessage(msg) {
if (this.closed) {
throw new Error('BroadcastChannel.postMessage(): ' + 'Cannot post message after channel has closed');
throw new Error('BroadcastChannel.postMessage(): ' + 'Cannot post message after channel has closed ' +
/**
* In the past when this error appeared, it was realy hard to debug.
* So now we log the msg together with the error so it at least
* gives some clue about where in your application this happens.
*/
JSON.stringify(msg));
}

return _post(this, 'message', msg);
Expand Down
34 changes: 14 additions & 20 deletions dist/lib/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,13 @@ function enforceOptions(options) {
BroadcastChannel.prototype = {
postMessage: function postMessage(msg) {
if (this.closed) {
throw new Error('BroadcastChannel.postMessage(): ' + 'Cannot post message after channel has closed');
throw new Error('BroadcastChannel.postMessage(): ' + 'Cannot post message after channel has closed ' +
/**
* In the past when this error appeared, it was realy hard to debug.
* So now we log the msg together with the error so it at least
* gives some clue about where in your application this happens.
*/
JSON.stringify(msg));
}

return _post(this, 'message', msg);
Expand Down Expand Up @@ -1686,31 +1692,19 @@ function _interopRequireDefault(obj) {
};
}

module.exports = _interopRequireDefault;
module.exports["default"] = module.exports, module.exports.__esModule = true;
module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
},{}],14:[function(require,module,exports){
function _typeof(obj) {
"@babel/helpers - typeof";

if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
module.exports = _typeof = function _typeof(obj) {
return typeof obj;
};

module.exports["default"] = module.exports, module.exports.__esModule = true;
} else {
module.exports = _typeof = function _typeof(obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};

module.exports["default"] = module.exports, module.exports.__esModule = true;
}

return _typeof(obj);
return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
return typeof obj;
} : function (obj) {
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
}

module.exports = _typeof;
module.exports["default"] = module.exports, module.exports.__esModule = true;
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
},{}],15:[function(require,module,exports){

},{}],16:[function(require,module,exports){
Expand Down
2 changes: 1 addition & 1 deletion dist/lib/browser.min.js

Large diffs are not rendered by default.

37 changes: 15 additions & 22 deletions docs/e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,13 @@ function enforceOptions(options) {
BroadcastChannel.prototype = {
postMessage: function postMessage(msg) {
if (this.closed) {
throw new Error('BroadcastChannel.postMessage(): ' + 'Cannot post message after channel has closed');
throw new Error('BroadcastChannel.postMessage(): ' + 'Cannot post message after channel has closed ' +
/**
* In the past when this error appeared, it was realy hard to debug.
* So now we log the msg together with the error so it at least
* gives some clue about where in your application this happens.
*/
JSON.stringify(msg));
}

return _post(this, 'message', msg);
Expand Down Expand Up @@ -1751,40 +1757,27 @@ function _asyncToGenerator(fn) {
};
}

module.exports = _asyncToGenerator;
module.exports["default"] = module.exports, module.exports.__esModule = true;
module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
},{}],15:[function(require,module,exports){
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}

module.exports = _interopRequireDefault;
module.exports["default"] = module.exports, module.exports.__esModule = true;
module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
},{}],16:[function(require,module,exports){
function _typeof(obj) {
"@babel/helpers - typeof";

if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
module.exports = _typeof = function _typeof(obj) {
return typeof obj;
};

module.exports["default"] = module.exports, module.exports.__esModule = true;
} else {
module.exports = _typeof = function _typeof(obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};

module.exports["default"] = module.exports, module.exports.__esModule = true;
}

return _typeof(obj);
return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
return typeof obj;
} : function (obj) {
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
}

module.exports = _typeof;
module.exports["default"] = module.exports, module.exports.__esModule = true;
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
},{}],17:[function(require,module,exports){
module.exports = require("regenerator-runtime");

Expand Down
34 changes: 14 additions & 20 deletions docs/iframe.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,13 @@ function enforceOptions(options) {
BroadcastChannel.prototype = {
postMessage: function postMessage(msg) {
if (this.closed) {
throw new Error('BroadcastChannel.postMessage(): ' + 'Cannot post message after channel has closed');
throw new Error('BroadcastChannel.postMessage(): ' + 'Cannot post message after channel has closed ' +
/**
* In the past when this error appeared, it was realy hard to debug.
* So now we log the msg together with the error so it at least
* gives some clue about where in your application this happens.
*/
JSON.stringify(msg));
}

return _post(this, 'message', msg);
Expand Down Expand Up @@ -1721,31 +1727,19 @@ function _interopRequireDefault(obj) {
};
}

module.exports = _interopRequireDefault;
module.exports["default"] = module.exports, module.exports.__esModule = true;
module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
},{}],15:[function(require,module,exports){
function _typeof(obj) {
"@babel/helpers - typeof";

if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
module.exports = _typeof = function _typeof(obj) {
return typeof obj;
};

module.exports["default"] = module.exports, module.exports.__esModule = true;
} else {
module.exports = _typeof = function _typeof(obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};

module.exports["default"] = module.exports, module.exports.__esModule = true;
}

return _typeof(obj);
return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
return typeof obj;
} : function (obj) {
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
}

module.exports = _typeof;
module.exports["default"] = module.exports, module.exports.__esModule = true;
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
},{}],16:[function(require,module,exports){

},{}],17:[function(require,module,exports){
Expand Down
34 changes: 14 additions & 20 deletions docs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,13 @@ function enforceOptions(options) {
BroadcastChannel.prototype = {
postMessage: function postMessage(msg) {
if (this.closed) {
throw new Error('BroadcastChannel.postMessage(): ' + 'Cannot post message after channel has closed');
throw new Error('BroadcastChannel.postMessage(): ' + 'Cannot post message after channel has closed ' +
/**
* In the past when this error appeared, it was realy hard to debug.
* So now we log the msg together with the error so it at least
* gives some clue about where in your application this happens.
*/
JSON.stringify(msg));
}

return _post(this, 'message', msg);
Expand Down Expand Up @@ -1721,31 +1727,19 @@ function _interopRequireDefault(obj) {
};
}

module.exports = _interopRequireDefault;
module.exports["default"] = module.exports, module.exports.__esModule = true;
module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
},{}],15:[function(require,module,exports){
function _typeof(obj) {
"@babel/helpers - typeof";

if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
module.exports = _typeof = function _typeof(obj) {
return typeof obj;
};

module.exports["default"] = module.exports, module.exports.__esModule = true;
} else {
module.exports = _typeof = function _typeof(obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};

module.exports["default"] = module.exports, module.exports.__esModule = true;
}

return _typeof(obj);
return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
return typeof obj;
} : function (obj) {
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
}

module.exports = _typeof;
module.exports["default"] = module.exports, module.exports.__esModule = true;
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
},{}],16:[function(require,module,exports){

},{}],17:[function(require,module,exports){
Expand Down
34 changes: 14 additions & 20 deletions docs/leader-iframe.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,13 @@ function enforceOptions(options) {
BroadcastChannel.prototype = {
postMessage: function postMessage(msg) {
if (this.closed) {
throw new Error('BroadcastChannel.postMessage(): ' + 'Cannot post message after channel has closed');
throw new Error('BroadcastChannel.postMessage(): ' + 'Cannot post message after channel has closed ' +
/**
* In the past when this error appeared, it was realy hard to debug.
* So now we log the msg together with the error so it at least
* gives some clue about where in your application this happens.
*/
JSON.stringify(msg));
}

return _post(this, 'message', msg);
Expand Down Expand Up @@ -1721,31 +1727,19 @@ function _interopRequireDefault(obj) {
};
}

module.exports = _interopRequireDefault;
module.exports["default"] = module.exports, module.exports.__esModule = true;
module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
},{}],15:[function(require,module,exports){
function _typeof(obj) {
"@babel/helpers - typeof";

if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
module.exports = _typeof = function _typeof(obj) {
return typeof obj;
};

module.exports["default"] = module.exports, module.exports.__esModule = true;
} else {
module.exports = _typeof = function _typeof(obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};

module.exports["default"] = module.exports, module.exports.__esModule = true;
}

return _typeof(obj);
return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
return typeof obj;
} : function (obj) {
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
}

module.exports = _typeof;
module.exports["default"] = module.exports, module.exports.__esModule = true;
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
},{}],16:[function(require,module,exports){

},{}],17:[function(require,module,exports){
Expand Down
Loading

0 comments on commit 7f36d56

Please sign in to comment.