             [clojure.tools.analyzer.js.utils
              :refer [desugar-ns-specs validate-ns-specs ns-resource ns->relpath res-path]]
             [cljs
+             [analyzer :as cljs.ana]
              [tagged-literals :as tags]
              [js-deps :as deps]]
+            [clojure.string :as s]
             [clojure.java.io :as io]
             [clojure.tools.reader :as reader]
             [clojure.tools.reader.reader-types :as readers])

  (reset! core-env
          (reader/read-string (slurp (io/resource "tools.analyzer.js/cached-env.res")))))

(defn setup-rt []
  (require 'cljs.core)
  (when-not (or (seq @core-env)
                (seq (restore-env)))

        core-macro-mappings (apply dissoc (core-macros) (:exclude refer-clojure))
        macro-mappings (reduce (fn [m [ns {:keys [refer]}]]
                                 (c.c/require ns)
                                 (reduce #(let [m (ns-resolve ns (name %2))]
                                            (if (:macro (meta m))
                                              (assoc %1 %2 m)
                                              %1)) m refer))
                               {} require-macros)]

    (swap! *env* assoc-in [:namespaces ns-name]
