 
       @scope._ = result
 
-      response:
-        status: 'ok'
-        eval: inspect(result, undefined, undefined, color: data.color)
+      respond response:
+                status: 'ok'
+                eval: inspect(result, undefined, undefined, color: data.color)
 
     catch e
       logger.error 'eval: error: ', e
-      response:
-        status: 'error'
-        error: e.toString()
+      respond response:
+                status: 'error'
+                error: e.toString()
 
 
 module.exports = Controller


      pump = Cc['@mozilla.org/network/input-stream-pump;1'].createInstance(Ci.nsIInputStreamPump)
      pump.init(stream, -1, -1, 0, 0, false)
      pump.asyncRead({
        onStartRequest: (request, context) =>
          log.radioactive this
          @request = ''

      list = for {file} in statements.children()
               file.basename

    respond response:
              status: 'ok'
              'statement.list': list

  statement_read: (data, respond) ->
    unless data
      respond response:
                status: 'error'
                error: "statement id required"
      return

    statement = Dir.profile.child('statements').child(data)

    if statement.exists()
      respond response:
                status: 'ok'
                'statement.read': statement.read()
    else
      respond response:
                status: 'error'
                error: "No statement found with id=#{data}"

  job_stop: (data, respond) ->
    logger.info 'Got request to stop job, shutting down'

    # job didn't finish, so it failed
    @job.fail 504, 'timeout.quit' unless @job.done

    respond response:
              status: 'ok'

  xul_quit: (data, resopnd) ->
    setTimeout (-> goQuitApplication()), 1000

    respond response:
              status: 'ok'

  page_dump: (data, respond) ->
    try
      respond response:
                status: 'ok'
                'page.dump': @job.player.page.dump()

    catch e
      logger.error 'page.dump: ', e
      respond response:
                status: 'error'
                error: e.toString()

  eval: (data, respond) ->
    try
      script = data.script
      @scope ||=
