File tree Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change 644
644
(.printStackTrace e))))
645
645
646
646
(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]
648
649
:or {init #()
649
650
need-prompt #(if (readers/indexing-reader? *in*)
650
651
(== (readers/get-column-number *in*) 1 )
659
660
(PushbackReader. (io/reader *in*))
660
661
1 " NO_SOURCE_FILE" )
661
662
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]]]}
663
665
: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
665
669
:or {warn-on-undeclared true }}
666
670
(merge
667
671
{:cache-analysis true :source-map true }
668
672
(cljsc/add-implicit-options
669
673
(merge-with (fn [a b] (if (nil? b) a b))
670
- ( - repl-options repl-env)
674
+ repl-opts
671
675
opts
672
676
{:init init
673
677
:need-prompt prompt
730
734
(analyze-source analyze-path opts))
731
735
(evaluate-form repl-env env " <cljs repl>"
732
736
(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 ))
735
739
{:line 1 :column 1 })
736
740
identity opts)
737
741
(catch Throwable e
Original file line number Diff line number Diff line change 122
122
(send ordering (fn [_] {:expecting nil :fns {}}))
123
123
(send-for-eval conn
124
124
(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 )] {})
126
127
identity))
127
128
128
129
(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"
496
497
repl /IJavaScriptEnv
497
498
(-setup [this opts]
498
499
(setup this opts))
500
+ repl /IReplEnvOptions
501
+ (-repl-options [this]
502
+ {:repl-requires
503
+ '[[clojure.browser.repl]]})
499
504
repl /IParseStacktrace
500
505
(-parse-stacktrace [this st err opts]
501
506
(parse-stacktrace this st err opts))
You can’t perform that action at this time.
0 commit comments