From 5596a8f6f7e23f6dfe45dc83bf077b0b688b84fb Mon Sep 17 00:00:00 2001 From: siikamiika Date: Sun, 5 Apr 2020 19:24:13 +0300 Subject: strict object property type check --- ext/mixed/js/core.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ext/mixed/js') 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'); } -- cgit v1.2.3