strict object property type check
This commit is contained in:
parent
aea7c590d1
commit
5596a8f6f7
@ -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');
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user