         scope (.initStandardObjects cx)
         base (io/resource "goog/base.js")
         deps (io/resource "goog/deps.js")
-        new-repl-env (merge (RhinoEnv. (atom #{})) {:cx cx :scope scope})]
+        new-repl-env (merge (RhinoEnv.) {:cx cx :scope scope})]
     (assert base "Can't find goog/base.js in classpath")
     (assert deps "Can't find goog/deps.js in classpath")
-    (swap! current-repl-env (fn [old] new-repl-env))
     (ScriptableObject/putProperty scope
       "___repl_env" (Context/javaToJS new-repl-env scope))
     (with-open [r (io/reader base)]

      (ScriptableObject/putProperty scope "__repl_opts"
        (Context/javaToJS opts scope))
      (repl/load-file repl-env "cljs/core.cljs" opts)
      (swap! (:loaded-libs repl-env) conj "cljs.core")
      (repl/evaluate-form repl-env env "<cljs repl>"
        '(ns cljs.user))
      (ScriptableObject/putProperty scope

  (:require [clojure.string :as string]
            [clojure.java.io :as io]
            [cljs.compiler :as comp]
            [cljs.analyzer :as ana]
            [cljs.repl :as repl]
            [cljs.util :as util])
  (:import [java.io File Reader]
           [org.mozilla.javascript Context ScriptableObject
                                   RhinoException Undefined]))

(def ^String bootjs
  (str "goog.require = function(rule){"
       "Packages.clojure.lang.RT[\"var\"](\"cljs.repl.rhino\",\"goog-require\")"
