         cacheKey: cacheKey
 
   reset: ->
-    @keywords = []
-    @cache = {}
+    [ @keywords, @cache ] = [ [], {} ]
 
   refresh: (@lastUI) ->
     @reset()
-    # Inform the background completer that we have a new vomnibar activation.
     @port.postMessage name: @name, handler: "refresh"
 
   cancel: ->
     # Inform the background completer that it may (should it choose to do so) abandon any pending query
-    # (because the user is typing, and there'll be another query along soon).
+    # (because the user is typing, and there will be another query along soon).
     @port.postMessage name: @name, handler: "cancel"
 
   # These are the actions we can perform when the user selects a result.

class BackgroundCompleter
  debug: true

  # name is background-page completer to connect to: "omni", "tabs", or "bookmarks".
  constructor: (@name) ->
    @port = chrome.runtime.connect name: "completions"
    @messageId = null
    # @keywords and @cache are both reset in @reset().
    # We only cache for the duration of a single vomnibar activation.
    @keywords = []
    @cache = {}
    @reset()

    @port.onMessage.addListener (msg) =>

              else
                @completionActions.navigateToUrl.curry result.url

          # Cache the results, but only if we have been told it's ok to do so (it could be that more results
          # will be posted shortly).  We cache the results even if they arrive late.
          if msg.mayCacheResults
            console.log "cache set:", "-#{msg.cacheKey}-" if @debug
            @cache[msg.cacheKey] = msg
