Skip to content
Browse files

CLJS-2581: Create a cljs.repl/*repl-env* dynamic var and bind it arou…

…nd cljs repl loops
  • Loading branch information
Bruce Hauman authored and swannodette committed Feb 28, 2018
1 parent 2b8d5ae commit 0f2a407ef6169da2836d560f5ad72527635f9606
Showing with 7 additions and 3 deletions.
  1. +2 −1 src/main/clojure/cljs/cli.clj
  2. +2 −1 src/main/clojure/cljs/core/server.clj
  3. +3 −1 src/main/clojure/cljs/repl.cljc
@@ -263,7 +263,8 @@ present"
(merge copts opts)))]
(binding [ana/*cljs-ns* 'cljs.user
repl/*repl-opts* opts
ana/*verbose* (:verbose opts)]
ana/*verbose* (:verbose opts)
repl/*repl-env* renv]
(when ana/*verbose*
(util/debug-prn "Compiler options:" (pr-str repl/*repl-opts*)))
(comp/with-core-cljs repl/*repl-opts*
@@ -79,7 +79,8 @@
(binding [*in* (or stdin in-reader)
*out* (PrintWriter-on #(out-fn {:tag :out :val %1}) nil)
*err* (PrintWriter-on #(out-fn {:tag :err :val %1}) nil)]
*err* (PrintWriter-on #(out-fn {:tag :err :val %1}) nil)
repl/*repl-env* repl-env]
(let [opts (merge opts (:merge-opts (repl/setup repl-env opts)))]
(binding [repl/*repl-opts* opts]
(repl/evaluate-form repl-env env "<cljs repl>"
@@ -35,6 +35,7 @@

(def ^:dynamic *cljs-verbose* false)
(def ^:dynamic *repl-opts* nil)
(def ^:dynamic *repl-env* nil)

(def known-repl-opts
"Set of all known REPL options."
@@ -856,7 +857,8 @@
(env/with-compiler-env (or compiler-env (env/default-compiler-env opts))
(when (:source-map opts)
(.start (Thread. (bound-fn [] (read-source-map "cljs/core.aot.js")))))
(binding [ana/*unchecked-if* false
(binding [*repl-env* repl-env
ana/*unchecked-if* false
ana/*unchecked-arrays* false
*err* (if bind-err
(cond-> *out*

0 comments on commit 0f2a407

Please sign in to comment.
You can’t perform that action at this time.