              {:status :error
               :value (str "Could not read return value: " ret)})))))
 
-(def loaded-libs (atom #{}))
-
 (defn- object-query-str
   "Given a list of goog namespaces, create a JavaScript string which, when evaluated,
   will return true if all of the namespaces exist and false if any do not exist."

(extend-protocol repl/IJavaScriptEnv
  clojure.lang.IPersistentMap
  (-setup [this]
    (do (comp/with-core-cljs (start-server this))
        (browser-eval "goog.provide('cljs.user');")))
  (-evaluate [_ _ js] (browser-eval js))
  (-load [this ns url] (load-javascript this ns url))
  (-put [_ _ _] nil)

    (if-let [request (read-request rdr)]
      (case (:method request)
        :get (handle-get opts conn request)
        :post (if (= (:content request) "ready")
                (do (reset! loaded-libs #{})
                    (send-for-eval conn
                                   "goog.provide('cljs.user');"
                                   identity))
                (do (return-value (:content request))
                    (set-connection conn)))
        (.close conn))
      (.close conn))))

