                      (if (= -1 idx)
                        (list s)
                        (let [end (.indexOf s "}" idx)
-                             inner (:name (confirm-var env (resolve-var env (symbol (subs s (+ 2 idx) end)))))]
+                             inner (:name (resolve-existing-var env (symbol (subs s (+ 2 idx) end))))]
                          (cons (subs s 0 idx) (cons inner (interp (subs s (inc end)))))))))]
       {:env env :op :js :code (apply str (interp form))})))
 


(def ^:dynamic *cljs-ns* 'cljs.user)
(def ^:dynamic *cljs-verbose* false)

(defn munge [s]
  (let [ms (clojure.lang.Compiler/munge (str s))


(defn repl
  "Note - repl will reload core.cljs every time, even if supplied old repl-env"
  [repl-env & {:keys [verbose warn-on-undeclared]}]
  (prn "Type: " :cljs/quit " to quit")
  (binding [*cljs-ns* 'cljs.user
            *cljs-verbose* verbose
            *cljs-warn-on-undeclared* warn-on-undeclared]
    (let [env {:context :statement :locals {}}]
      (load-file repl-env "cljs/core.cljs")
      (eval1 repl-env (assoc env :ns (@namespaces *cljs-ns*))
