cljs.repl/load-namespace

functionsince v0.0-927Edit
(load-namespace repl-env ns)
(load-namespace repl-env ns opts)

Source docstring:
Load a namespace and all of its dependencies into the evaluation environment.
The environment is responsible for ensuring that each namespace is
loaded once and only once. Returns the compiled sources.
Source code @ clojurescript:src/main/clojure/cljs/repl.cljc
(defn load-namespace
  ([repl-env ns] (load-namespace repl-env ns nil))
  ([repl-env ns opts]
   (let [ns      (if (and (seq? ns) (= (first ns) 'quote)) (second ns) ns)
         sources (seq
                   (when-not (ana/node-module-dep? ns)
                     (let [input (ns->input ns opts)]
                       (if (compilable? input)
                         (->> (cljsc/compile-inputs [input]
                                (merge (env->opts repl-env) opts))
                           (remove (comp #{["goog"]} :provides)))
                         (map #(cljsc/source-on-disk opts %)
                              (cljsc/add-js-sources [input] opts))))))]
     (when (:repl-verbose opts)
       (println (str "load-namespace " ns " , compiled:") (map :provides sources)))
     (load-sources repl-env sources opts)
     sources)))