 # Several Google completion engines package responses as XML. This parses such XML.
 class GoogleXMLBaseEngine extends BaseEngine
   parse: (xhr) ->
-    for suggestion in xhr.responseXML.getElementsByTagName "suggestion"
-      continue unless suggestion = suggestion.getAttribute "data"
-      suggestion
+    Array.from(xhr.responseXML.getElementsByTagName("suggestion"))
+    .map((e) => suggestion.getAttribute("data"))
+    .filter((e) => e)
 
 class Google extends GoogleXMLBaseEngine
   constructor: () ->

class BaseEngine
  constructor: (options) ->
    extend this, options
    @regexps = [ @regexps ] if "string" == typeof @regexps
    @regexps = @regexps.map (regexp) -> new RegExp regexp


          """

  parse: (xhr) ->
    Array.from(super(xhr))
    .filter((suggestion) => suggestion.startsWith(@prefix))
    .map((suggestion) => suggestion[@prefix.length..])

class Youtube extends GoogleXMLBaseEngine
  constructor: ->
