   #   keystroke patterns to commands.
   addKeyBindings: (source, keyBindingsBySelector) ->
     for selector, keyBindings of keyBindingsBySelector
-      # Verify selector is valid before registering any bindings
-      try
-        document.body.webkitMatchesSelector(selector)
-      catch
-        console.warn("Encountered an invalid selector adding keybindings from '#{source}': '#{selector}'")
-        continue
+      @addKeyBindingsForSelector(source, selector, keyBindings)
 
-      for keystroke, command of keyBindings
-        keyBinding = new KeyBinding(source, command, keystroke, selector)
-        @keyBindings.push(keyBinding)
+  addKeyBindingsForSelector: (source, selector, keyBindings) ->
+    # Verify selector is valid before registering any bindings
+    try
+      document.body.webkitMatchesSelector(selector)
+    catch
+      console.warn("Encountered an invalid selector adding keybindings from '#{source}': '#{selector}'")
+      return
+
+    for keystroke, command of keyBindings
+      keyBinding = new KeyBinding(source, command, keystroke, selector)
+      @keyBindings.push(keyBinding)
 
   handleKeyboardEvent: (event) ->
     @keystrokes.push(@keystrokeForKeyboardEvent(event))


  # Deprecated: Handle a jQuery keyboard event. Use {::handleKeyboardEvent} with
  # a raw keyboard event instead.
  handleEvent: (event) ->
    @handleKeyboardEvent(event.originalEvent ? event)

  # Deprecated: Translate a jQuery keyboard event to a keystroke string. Use
  # {::keystrokeForKeyboardEvent} with a raw KeyboardEvent instead.
  keystrokeStringForEvent: (event) ->
    @keystrokeForKeyboardEvent(event.originalEvent ? event)

    @keyBindings = []
    @keystrokes = []

  destroy: ->

  # Public: Add sets of key bindings grouped by CSS selector.
  #
  # source - A {String} (usually a path) uniquely identifying the given bindings
