                    (try
                      (identical? (read-eval-print) request-exit)
                      (catch Throwable e
-                       (caught e opts)
+                       (caught e repl-env opts)
                        nil))
                    (when (need-prompt)
                      (prompt)

             is-special-fn? (set (keys special-fns))
             request-prompt (Object.)
             request-exit (Object.)
             opts (if-let [merge-opts (:merge-opts (-setup repl-env opts))]
                    (merge opts merge-opts)
                    opts)
             read-eval-print
             (fn []
               (let [input (binding [*ns* (create-ns ana/*cljs-ns*)

(defn repl-prompt []
  (print (str "ClojureScript:" ana/*cljs-ns* "> ")))

(defn repl-caught [e repl-env opts]
  (if (and (instance? IExceptionInfo e)
           (#{:js-eval-error :js-eval-exception} (:type (ex-data e))))
    (let [{:keys [type repl-env error form js]} (ex-data e)]
