cljs.repl/run-inits

functionsince v1.10.63Edit
(run-inits renv inits)

Source code @ clojurescript:src/main/clojure/cljs/repl.cljc
(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)))))