cljs.repl/run-inits
function | since v1.10.63 | Edit |
(run-inits renv inits)
(defn run-inits [renv inits]
(doseq [{:keys [type] :as init} inits]
(case type
:init-forms
(doseq [form (:forms init)]
(eval-cljs renv (ana/empty-env) form))
:eval-forms
(binding [*repl-opts* (merge *repl-opts* {:def-emits-var true :wrap init-wrap-fn})]
(doseq [form (:forms init)]
(let [value (eval-cljs renv (ana/empty-env) form *repl-opts*)]
(when-not (repl-nil? value)
(println value)))))
:init-script
(let [script (:script init)]
(load-stream renv (util/get-name script) script)))))