aboutsummaryrefslogtreecommitdiff
path: root/ext/mixed
diff options
context:
space:
mode:
authorsiikamiika <siikamiika@users.noreply.github.com>2020-04-05 19:24:13 +0300
committersiikamiika <siikamiika@users.noreply.github.com>2020-04-05 20:03:45 +0300
commit5596a8f6f7e23f6dfe45dc83bf077b0b688b84fb (patch)
tree2027a823c1f1eb411305cc1de584f7b782b35f97 /ext/mixed
parentaea7c590d1b381786978cd7871aed545be96ce34 (diff)
strict object property type check
Diffstat (limited to 'ext/mixed')
-rw-r--r--ext/mixed/js/core.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/mixed/js/core.js b/ext/mixed/js/core.js
index 5f9e172d..6d0a5f0e 100644
--- a/ext/mixed/js/core.js
+++ b/ext/mixed/js/core.js
@@ -318,10 +318,10 @@ const yomichan = (() => {
}
getTemporaryListenerResult(eventHandler, userCallback, timeout=null) {
- if (
- typeof eventHandler.addListener === 'undefined' ||
- typeof eventHandler.removeListener === 'undefined'
- ) {
+ if (!(
+ typeof eventHandler.addListener === 'function' ||
+ typeof eventHandler.removeListener === 'function'
+ )) {
throw new Error('Event handler type not supported');
}