Throw error for commands with non-function callbacks

This commit is contained in:
Ivan Zuzak
2015-06-22 07:59:08 +02:00
parent 6521c869c4
commit d47737718b

View File

@@ -93,6 +93,9 @@ class CommandRegistry
return disposable
if typeof target is 'string'
if typeof callback isnt 'function'
throw new Error("Can't register a command with non-function callback.")
validateSelector(target)
@addSelectorBasedListener(target, commandName, callback)
else