              (js/CLOSURE_IMPORT_SCRIPT
                (aget (.. js/goog -dependencies_ -nameToPath) name))))))))
 
-(defrecord JscEnv [host port socket response-channel]
+(defrecord JscEnv [host port socket response-promise]
   repl/IJavaScriptEnv
   (-setup [this opts]
     (setup this opts))

  (.start
        (Thread.
          #(try
            (let [rv (read-messages (:in @(:socket repl-env)) (:response-channel repl-env))]
              (when (= :eof rv)
                (close-socket @(:socket repl-env))))
            (catch IOException e

  [repl-env js]
  (let [{:keys [out]} @(:socket repl-env)
        response-promise (promise)]
    (reset! (:response-promise repl-env) response-promise)
    (write out js)
    (let [response @response-promise]
      (if (= :eof response)
