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) {
|
getTemporaryListenerResult(eventHandler, userCallback, timeout=null) {
|
||||||
if (
|
if (!(
|
||||||
typeof eventHandler.addListener === 'undefined' ||
|
typeof eventHandler.addListener === 'function' ||
|
||||||
typeof eventHandler.removeListener === 'undefined'
|
typeof eventHandler.removeListener === 'function'
|
||||||
) {
|
)) {
|
||||||
throw new Error('Event handler type not supported');
|
throw new Error('Event handler type not supported');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user