mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Throw error for commands with non-function callbacks
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user