diff options
author | Marco Ambrosini <marcoambrosini@pm.me> | 2021-06-15 17:17:47 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2021-06-17 17:48:26 +0300 |
commit | 2bba6b48760ead80bdc0ec1abba4a28f49703f6f (patch) | |
tree | c89e4e24a1f66b907e3debd34a3e0174b43a8612 /src/utils/signaling.js | |
parent | a3add6abe9c198633f77ec955779dd9262e91930 (diff) |
Fix hasOwnProperty
Signed-off-by: Marco Ambrosini <marcoambrosini@pm.me>
Diffstat (limited to 'src/utils/signaling.js')
-rw-r--r-- | src/utils/signaling.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/utils/signaling.js b/src/utils/signaling.js index bcab440e4..e9f19f006 100644 --- a/src/utils/signaling.js +++ b/src/utils/signaling.js @@ -82,7 +82,7 @@ function Base(settings) { Signaling.Base = Base Signaling.Base.prototype.on = function(ev, handler) { - if (!this.handlers.hasOwnProperty(ev)) { + if (!Object.prototype.hasOwnProperty.call(this.handlers, ev)) { this.handlers[ev] = [handler] } else { this.handlers[ev].push(handler) @@ -101,7 +101,7 @@ Signaling.Base.prototype.on = function(ev, handler) { } Signaling.Base.prototype.off = function(ev, handler) { - if (!this.handlers.hasOwnProperty(ev)) { + if (!Object.prototype.hasOwnProperty.call(this.handlers, ev)) { return } @@ -661,7 +661,7 @@ Signaling.Standalone.prototype.connect = function() { console.debug('Received', data) } const id = data.id - if (id && this.callbacks.hasOwnProperty(id)) { + if (id && Object.prototype.hasOwnProperty.call(this.callbacks, id)) { const cb = this.callbacks[id] delete this.callbacks[id] cb(data) |