Skip to content

Commit

Permalink
5.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pubkey committed Apr 25, 2023
1 parent 2edd974 commit 54b8078
Show file tree
Hide file tree
Showing 17 changed files with 7,654 additions and 1,021 deletions.
3 changes: 1 addition & 2 deletions dist/es5node/leader-election-web-lock.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ LeaderElectionWebLock.prototype = {
},
die: function die() {
var _this4 = this;
var ret = (0, _leaderElectionUtil.sendLeaderMessage)(this, 'death');
this._lstns.forEach(function (listener) {
return _this4.broadcastChannel.removeEventListener('internal', listener);
});
Expand All @@ -91,6 +90,6 @@ LeaderElectionWebLock.prototype = {
if (this._wKMC.c) {
this._wKMC.c.abort('LeaderElectionWebLock.die() called');
}
return ret;
return (0, _leaderElectionUtil.sendLeaderMessage)(this, 'death');
}
};
5 changes: 1 addition & 4 deletions dist/es5node/methods/native.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,7 @@ function onMessage(channelState, fn) {
channelState.messagesCallback = fn;
}
function canBeUsed() {
if (typeof window === 'undefined') {
return false;
}
if (typeof BroadcastChannel === 'function') {
if ((typeof window !== 'undefined' || typeof self !== 'undefined') && typeof BroadcastChannel === 'function') {
if (BroadcastChannel._pubkey) {
throw new Error('BroadcastChannel: Do not overwrite window.BroadcastChannel with this module, this is not a polyfill');
}
Expand Down
3 changes: 1 addition & 2 deletions dist/esbrowser/leader-election-web-lock.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ LeaderElectionWebLock.prototype = {
},
die: function die() {
var _this4 = this;
var ret = sendLeaderMessage(this, 'death');
this._lstns.forEach(function (listener) {
return _this4.broadcastChannel.removeEventListener('internal', listener);
});
Expand All @@ -85,6 +84,6 @@ LeaderElectionWebLock.prototype = {
if (this._wKMC.c) {
this._wKMC.c.abort('LeaderElectionWebLock.die() called');
}
return ret;
return sendLeaderMessage(this, 'death');
}
};
5 changes: 1 addition & 4 deletions dist/esbrowser/methods/native.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ export function onMessage(channelState, fn) {
channelState.messagesCallback = fn;
}
export function canBeUsed() {
if (typeof window === 'undefined') {
return false;
}
if (typeof BroadcastChannel === 'function') {
if ((typeof window !== 'undefined' || typeof self !== 'undefined') && typeof BroadcastChannel === 'function') {
if (BroadcastChannel._pubkey) {
throw new Error('BroadcastChannel: Do not overwrite window.BroadcastChannel with this module, this is not a polyfill');
}
Expand Down
3 changes: 1 addition & 2 deletions dist/esnode/leader-election-web-lock.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ LeaderElectionWebLock.prototype = {
},
die: function die() {
var _this4 = this;
var ret = sendLeaderMessage(this, 'death');
this._lstns.forEach(function (listener) {
return _this4.broadcastChannel.removeEventListener('internal', listener);
});
Expand All @@ -85,6 +84,6 @@ LeaderElectionWebLock.prototype = {
if (this._wKMC.c) {
this._wKMC.c.abort('LeaderElectionWebLock.die() called');
}
return ret;
return sendLeaderMessage(this, 'death');
}
};
5 changes: 1 addition & 4 deletions dist/esnode/methods/native.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ export function onMessage(channelState, fn) {
channelState.messagesCallback = fn;
}
export function canBeUsed() {
if (typeof window === 'undefined') {
return false;
}
if (typeof BroadcastChannel === 'function') {
if ((typeof window !== 'undefined' || typeof self !== 'undefined') && typeof BroadcastChannel === 'function') {
if (BroadcastChannel._pubkey) {
throw new Error('BroadcastChannel: Do not overwrite window.BroadcastChannel with this module, this is not a polyfill');
}
Expand Down
8 changes: 2 additions & 6 deletions dist/lib/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,6 @@ LeaderElectionWebLock.prototype = {
},
die: function die() {
var _this4 = this;
var ret = (0, _leaderElectionUtil.sendLeaderMessage)(this, 'death');
this._lstns.forEach(function (listener) {
return _this4.broadcastChannel.removeEventListener('internal', listener);
});
Expand All @@ -493,7 +492,7 @@ LeaderElectionWebLock.prototype = {
if (this._wKMC.c) {
this._wKMC.c.abort('LeaderElectionWebLock.die() called');
}
return ret;
return (0, _leaderElectionUtil.sendLeaderMessage)(this, 'death');
}
};
},{"./leader-election-util.js":5,"./util.js":14}],7:[function(require,module,exports){
Expand Down Expand Up @@ -1441,10 +1440,7 @@ function onMessage(channelState, fn) {
channelState.messagesCallback = fn;
}
function canBeUsed() {
if (typeof window === 'undefined') {
return false;
}
if (typeof BroadcastChannel === 'function') {
if ((typeof window !== 'undefined' || typeof self !== 'undefined') && typeof BroadcastChannel === 'function') {
if (BroadcastChannel._pubkey) {
throw new Error('BroadcastChannel: Do not overwrite window.BroadcastChannel with this module, this is not a polyfill');
}
Expand Down
2 changes: 1 addition & 1 deletion dist/lib/browser.min.js

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions dist/lib/leader-election-web-lock.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ LeaderElectionWebLock.prototype = {
},
die: function die() {
var _this4 = this;
var ret = (0, _leaderElectionUtil.sendLeaderMessage)(this, 'death');
this._lstns.forEach(function (listener) {
return _this4.broadcastChannel.removeEventListener('internal', listener);
});
Expand All @@ -91,6 +90,6 @@ LeaderElectionWebLock.prototype = {
if (this._wKMC.c) {
this._wKMC.c.abort('LeaderElectionWebLock.die() called');
}
return ret;
return (0, _leaderElectionUtil.sendLeaderMessage)(this, 'death');
}
};
5 changes: 1 addition & 4 deletions dist/lib/methods/native.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,7 @@ function onMessage(channelState, fn) {
channelState.messagesCallback = fn;
}
function canBeUsed() {
if (typeof window === 'undefined') {
return false;
}
if (typeof BroadcastChannel === 'function') {
if ((typeof window !== 'undefined' || typeof self !== 'undefined') && typeof BroadcastChannel === 'function') {
if (BroadcastChannel._pubkey) {
throw new Error('BroadcastChannel: Do not overwrite window.BroadcastChannel with this module, this is not a polyfill');
}
Expand Down
Loading

0 comments on commit 54b8078

Please sign in to comment.