File tree Expand file tree Collapse file tree 4 files changed +15
-9
lines changed Expand file tree Collapse file tree 4 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -2057,7 +2057,7 @@ argument, which the reader will use in any emitted errors."
2057
2057
*cljs-file* path
2058
2058
reader/*alias-map* (or reader/*alias-map* {})]
2059
2059
(when (or *verbose* (:verbose opts))
2060
- (util/debug-prn " Analyzing " res))
2060
+ (util/debug-prn " Analyzing" ( str res) ))
2061
2061
(let [env (assoc (empty-env ) :build-options opts)
2062
2062
ns (loop [ns nil forms (seq (forms-seq res))]
2063
2063
(if forms
@@ -2079,7 +2079,7 @@ argument, which the reader will use in any emitted errors."
2079
2079
:analyze-deps true
2080
2080
:load-macros true }))]
2081
2081
(when (or *verbose* (:verbose opts))
2082
- (util/debug-prn " Reading analysis cache for " res))
2082
+ (util/debug-prn " Reading analysis cache for" ( str res) ))
2083
2083
(swap! env/*compiler*
2084
2084
(fn [cenv]
2085
2085
(let [cached-ns (edn/read-string (slurp cache))]
Original file line number Diff line number Diff line change 978
978
(with-core-cljs opts
979
979
(fn []
980
980
(when (or ana/*verbose* (:verbose opts))
981
- (util/debug-prn " Compiling " src))
981
+ (util/debug-prn " Compiling" ( str src) ))
982
982
(if-let [cached (and (= (:optimizations opts) :none )
983
983
(= (:ns (ana/parse-ns src)) 'cljs.core)
984
984
(io/resource " cljs/core.aot.js" ))]
985
985
; ; no need to bother with analysis cache reading, handled by
986
986
; ; with-core-cljs
987
987
(do
988
988
(when (or ana/*verbose* (:verbose opts))
989
- (util/debug-prn " Using cached cljs.core " src))
989
+ (util/debug-prn " Using cached cljs.core" ( str src) ))
990
990
(spit dest (slurp cached))
991
991
(when (true ? (:source-map opts))
992
992
(spit (io/file (str dest " .map" ))
Original file line number Diff line number Diff line change 654
654
print-no-newline print
655
655
source-map-inline true }
656
656
:as opts}]
657
- (print " To quit, type:" :cljs/quit )
658
657
(let [{:keys [analyze-path repl-verbose warn-on-undeclared special-fns static-fns] :as opts
659
658
:or {warn-on-undeclared true }}
660
659
(merge
733
732
(future
734
733
(let [log-file (io/file (util/output-directory opts) " watch.log" )]
735
734
(print " Watch compilation log available at:" (str log-file))
735
+ (flush )
736
736
(try
737
- (binding [*out* (FileWriter. log-file)]
738
- (cljsc/watch src (dissoc opts :watch )))
737
+ (let [log-out (FileWriter. log-file)]
738
+ (binding [*err* log-out
739
+ *out* log-out]
740
+ (cljsc/watch src (dissoc opts :watch ))))
739
741
(catch Throwable e
740
742
(caught e repl-env opts))))))
743
+ ; ; let any setup async messages flush
744
+ (Thread/sleep 50 )
741
745
(binding [*in* (if (true ? (:source-map-inline opts))
742
746
*in*
743
747
(reader ))]
744
748
(try
745
749
(init )
746
750
(catch Throwable e
747
751
(caught e repl-env opts)))
752
+ (print " To quit, type:" :cljs/quit )
748
753
(prompt )
749
754
(flush )
750
755
(loop []
Original file line number Diff line number Diff line change 128
128
129
129
(defn debug-prn
130
130
[& args]
131
- (.println System/err (apply str args)))
131
+ (binding [*out* *err*]
132
+ (apply println args)))
132
133
133
134
(defmacro measure
134
135
" Like cljs.core/time but toggleable and takes a message string."
138
139
`(if ~enable
139
140
(let [start# (. System (nanoTime ))
140
141
ret# ~expr]
141
- (debug-prn ( str ~msg " , elapsed time: " (/ (double (- (. System (nanoTime )) start#)) 1000000.0 ) " msecs" ) )
142
+ (debug-prn ~msg " , elapsed time:" (/ (double (- (. System (nanoTime )) start#)) 1000000.0 ) " msecs" )
142
143
ret#)
143
144
~expr)))
You can’t perform that action at this time.
0 commit comments