Skip to content

Commit 54b8078

Browse files
committed
5.1.0
1 parent 2edd974 commit 54b8078

17 files changed

+7654
-1021
lines changed

dist/es5node/leader-election-web-lock.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ LeaderElectionWebLock.prototype = {
7272
},
7373
die: function die() {
7474
var _this4 = this;
75-
var ret = (0, _leaderElectionUtil.sendLeaderMessage)(this, 'death');
7675
this._lstns.forEach(function (listener) {
7776
return _this4.broadcastChannel.removeEventListener('internal', listener);
7877
});
@@ -91,6 +90,6 @@ LeaderElectionWebLock.prototype = {
9190
if (this._wKMC.c) {
9291
this._wKMC.c.abort('LeaderElectionWebLock.die() called');
9392
}
94-
return ret;
93+
return (0, _leaderElectionUtil.sendLeaderMessage)(this, 'death');
9594
}
9695
};

dist/es5node/methods/native.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,7 @@ function onMessage(channelState, fn) {
4747
channelState.messagesCallback = fn;
4848
}
4949
function canBeUsed() {
50-
if (typeof window === 'undefined') {
51-
return false;
52-
}
53-
if (typeof BroadcastChannel === 'function') {
50+
if ((typeof window !== 'undefined' || typeof self !== 'undefined') && typeof BroadcastChannel === 'function') {
5451
if (BroadcastChannel._pubkey) {
5552
throw new Error('BroadcastChannel: Do not overwrite window.BroadcastChannel with this module, this is not a polyfill');
5653
}

dist/esbrowser/leader-election-web-lock.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ LeaderElectionWebLock.prototype = {
6666
},
6767
die: function die() {
6868
var _this4 = this;
69-
var ret = sendLeaderMessage(this, 'death');
7069
this._lstns.forEach(function (listener) {
7170
return _this4.broadcastChannel.removeEventListener('internal', listener);
7271
});
@@ -85,6 +84,6 @@ LeaderElectionWebLock.prototype = {
8584
if (this._wKMC.c) {
8685
this._wKMC.c.abort('LeaderElectionWebLock.die() called');
8786
}
88-
return ret;
87+
return sendLeaderMessage(this, 'death');
8988
}
9089
};

dist/esbrowser/methods/native.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@ export function onMessage(channelState, fn) {
3131
channelState.messagesCallback = fn;
3232
}
3333
export function canBeUsed() {
34-
if (typeof window === 'undefined') {
35-
return false;
36-
}
37-
if (typeof BroadcastChannel === 'function') {
34+
if ((typeof window !== 'undefined' || typeof self !== 'undefined') && typeof BroadcastChannel === 'function') {
3835
if (BroadcastChannel._pubkey) {
3936
throw new Error('BroadcastChannel: Do not overwrite window.BroadcastChannel with this module, this is not a polyfill');
4037
}

dist/esnode/leader-election-web-lock.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ LeaderElectionWebLock.prototype = {
6666
},
6767
die: function die() {
6868
var _this4 = this;
69-
var ret = sendLeaderMessage(this, 'death');
7069
this._lstns.forEach(function (listener) {
7170
return _this4.broadcastChannel.removeEventListener('internal', listener);
7271
});
@@ -85,6 +84,6 @@ LeaderElectionWebLock.prototype = {
8584
if (this._wKMC.c) {
8685
this._wKMC.c.abort('LeaderElectionWebLock.die() called');
8786
}
88-
return ret;
87+
return sendLeaderMessage(this, 'death');
8988
}
9089
};

dist/esnode/methods/native.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@ export function onMessage(channelState, fn) {
3131
channelState.messagesCallback = fn;
3232
}
3333
export function canBeUsed() {
34-
if (typeof window === 'undefined') {
35-
return false;
36-
}
37-
if (typeof BroadcastChannel === 'function') {
34+
if ((typeof window !== 'undefined' || typeof self !== 'undefined') && typeof BroadcastChannel === 'function') {
3835
if (BroadcastChannel._pubkey) {
3936
throw new Error('BroadcastChannel: Do not overwrite window.BroadcastChannel with this module, this is not a polyfill');
4037
}

dist/lib/browser.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,6 @@ LeaderElectionWebLock.prototype = {
474474
},
475475
die: function die() {
476476
var _this4 = this;
477-
var ret = (0, _leaderElectionUtil.sendLeaderMessage)(this, 'death');
478477
this._lstns.forEach(function (listener) {
479478
return _this4.broadcastChannel.removeEventListener('internal', listener);
480479
});
@@ -493,7 +492,7 @@ LeaderElectionWebLock.prototype = {
493492
if (this._wKMC.c) {
494493
this._wKMC.c.abort('LeaderElectionWebLock.die() called');
495494
}
496-
return ret;
495+
return (0, _leaderElectionUtil.sendLeaderMessage)(this, 'death');
497496
}
498497
};
499498
},{"./leader-election-util.js":5,"./util.js":14}],7:[function(require,module,exports){
@@ -1441,10 +1440,7 @@ function onMessage(channelState, fn) {
14411440
channelState.messagesCallback = fn;
14421441
}
14431442
function canBeUsed() {
1444-
if (typeof window === 'undefined') {
1445-
return false;
1446-
}
1447-
if (typeof BroadcastChannel === 'function') {
1443+
if ((typeof window !== 'undefined' || typeof self !== 'undefined') && typeof BroadcastChannel === 'function') {
14481444
if (BroadcastChannel._pubkey) {
14491445
throw new Error('BroadcastChannel: Do not overwrite window.BroadcastChannel with this module, this is not a polyfill');
14501446
}

dist/lib/browser.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/lib/leader-election-web-lock.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ LeaderElectionWebLock.prototype = {
7272
},
7373
die: function die() {
7474
var _this4 = this;
75-
var ret = (0, _leaderElectionUtil.sendLeaderMessage)(this, 'death');
7675
this._lstns.forEach(function (listener) {
7776
return _this4.broadcastChannel.removeEventListener('internal', listener);
7877
});
@@ -91,6 +90,6 @@ LeaderElectionWebLock.prototype = {
9190
if (this._wKMC.c) {
9291
this._wKMC.c.abort('LeaderElectionWebLock.die() called');
9392
}
94-
return ret;
93+
return (0, _leaderElectionUtil.sendLeaderMessage)(this, 'death');
9594
}
9695
};

dist/lib/methods/native.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,7 @@ function onMessage(channelState, fn) {
4747
channelState.messagesCallback = fn;
4848
}
4949
function canBeUsed() {
50-
if (typeof window === 'undefined') {
51-
return false;
52-
}
53-
if (typeof BroadcastChannel === 'function') {
50+
if ((typeof window !== 'undefined' || typeof self !== 'undefined') && typeof BroadcastChannel === 'function') {
5451
if (BroadcastChannel._pubkey) {
5552
throw new Error('BroadcastChannel: Do not overwrite window.BroadcastChannel with this module, this is not a polyfill');
5653
}

0 commit comments

Comments
 (0)