File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 644644 (.printStackTrace e))))
645645
646646(defn repl*
647- [repl-env {:keys [init need-prompt prompt flush read eval print caught reader print-no-newline source-map-inline wrap]
647+ [repl-env {:keys [init need-prompt prompt flush read eval print caught reader
648+ print-no-newline source-map-inline wrap repl-requires]
648649 :or {init #()
649650 need-prompt #(if (readers/indexing-reader? *in*)
650651 (== (readers/get-column-number *in*) 1 )
659660 (PushbackReader. (io/reader *in*))
660661 1 " NO_SOURCE_FILE" )
661662 print-no-newline print
662- source-map-inline true }
663+ source-map-inline true
664+ repl-requires '[[cljs.repl :refer-macros [source doc find-doc apropos dir pst]]]}
663665 :as opts}]
664- (let [{:keys [analyze-path repl-verbose warn-on-undeclared special-fns static-fns] :as opts
666+ (let [repl-opts (-repl-options repl-env)
667+ repl-requires (into repl-requires (:repl-requires repl-opts))
668+ {:keys [analyze-path repl-verbose warn-on-undeclared special-fns static-fns] :as opts
665669 :or {warn-on-undeclared true }}
666670 (merge
667671 {:cache-analysis true :source-map true }
668672 (cljsc/add-implicit-options
669673 (merge-with (fn [a b] (if (nil? b) a b))
670- ( - repl-options repl-env)
674+ repl-opts
671675 opts
672676 {:init init
673677 :need-prompt prompt
730734 (analyze-source analyze-path opts))
731735 (evaluate-form repl-env env " <cljs repl>"
732736 (with-meta
733- '( ns cljs.user
734- (:require [cljs. repl :refer-macros [source doc find-doc apropos dir pst]] ))
737+ `(~' ns ~' cljs.user
738+ (:require ~@ repl-requires ))
735739 {:line 1 :column 1 })
736740 identity opts)
737741 (catch Throwable e
Original file line number Diff line number Diff line change 122122 (send ordering (fn [_] {:expecting nil :fns {}}))
123123 (send-for-eval conn
124124 (cljsc/-compile
125- '[(set! *print-fn* clojure.browser.repl/repl-print)] {})
125+ '[(set! *print-fn* clojure.browser.repl/repl-print)
126+ (set! *print-newline* true )] {})
126127 identity))
127128
128129(defn add-in-order [{:keys [expecting fns]} order f]
@@ -496,6 +497,10 @@ goog.events.getProxy/f<@http://localhost:9000/out/goog/events/events.js:276:16"
496497 repl /IJavaScriptEnv
497498 (-setup [this opts]
498499 (setup this opts))
500+ repl /IReplEnvOptions
501+ (-repl-options [this]
502+ {:repl-requires
503+ '[[clojure.browser.repl]]})
499504 repl /IParseStacktrace
500505 (-parse-stacktrace [this st err opts]
501506 (parse-stacktrace this st err opts))
You can’t perform that action at this time.
0 commit comments