From 9aa78606b326cfbe0e82acff388230f76b2c5987 Mon Sep 17 00:00:00 2001 From: Ivan Zuzak Date: Mon, 22 Jun 2015 18:47:41 +0200 Subject: [PATCH] Catch both string and object targets --- src/command-registry.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/command-registry.coffee b/src/command-registry.coffee index a9b953536..870093e2f 100644 --- a/src/command-registry.coffee +++ b/src/command-registry.coffee @@ -92,10 +92,10 @@ class CommandRegistry disposable.add @add(target, commandName, callback) return disposable - if typeof target is 'string' - if typeof callback isnt 'function' - throw new Error("Can't register a command with non-function callback.") + if typeof callback isnt 'function' + throw new Error("Can't register a command with non-function callback.") + if typeof target is 'string' validateSelector(target) @addSelectorBasedListener(target, commandName, callback) else