From 6d5c1a4a70870e8ab5a36f9590875460a10c67b0 Mon Sep 17 00:00:00 2001 From: cha0s Date: Mon, 18 Jan 2021 21:02:52 -0600 Subject: [PATCH] chore: error --- packages/core/src/event-emitter.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/core/src/event-emitter.js b/packages/core/src/event-emitter.js index d0f0045..795b54b 100644 --- a/packages/core/src/event-emitter.js +++ b/packages/core/src/event-emitter.js @@ -107,6 +107,9 @@ export default function EventEmitterMixin(Superclass) { } onSingleEvent(type, fn, that, once) { + if ('function' !== typeof fn) { + throw new TypeError('EventEmitter::onSingleEvent() requires function listener'); + } const listener = createListener(fn, that, type, once); if (!(type in this.$$events)) { this.$$events[type] = [];