File tree 2 files changed +28
-25
lines changed
2 files changed +28
-25
lines changed Original file line number Diff line number Diff line change @@ -1310,6 +1310,19 @@ should contain the source for the given namespace name."
1310
1310
(and (satisfies? deps/IJavaScript js)
1311
1311
(deps/-foreign? js)))
1312
1312
1313
+ (defn add-implicit-options [opts]
1314
+ (let [{:keys [libs foreign-libs externs]} (get-upstream-deps )]
1315
+ (cond->
1316
+ (-> opts
1317
+ (assoc
1318
+ :ups-libs libs
1319
+ :ups-foreign-libs foreign-libs
1320
+ :ups-externs externs)
1321
+ (update-in [:preamble ] #(into (or % []) [" cljs/imul.js" ])))
1322
+ (:target opts)
1323
+ (assoc-in [:closure-defines " cljs.core.target" ]
1324
+ (name (:target opts))))))
1325
+
1313
1326
(defn build
1314
1327
" Given a source which can be compiled, produce runnable JavaScript."
1315
1328
([source opts]
@@ -1320,15 +1333,7 @@ should contain the source for the given namespace name."
1320
1333
([source opts compiler-env]
1321
1334
(env/with-compiler-env compiler-env
1322
1335
(let [compiler-stats (:compiler-stats opts)
1323
- ups-deps (get-upstream-deps )
1324
- all-opts (cond->
1325
- (-> opts
1326
- (assoc
1327
- :ups-libs (:libs ups-deps)
1328
- :ups-foreign-libs (:foreign-libs ups-deps)
1329
- :ups-externs (:externs ups-deps))
1330
- (update-in [:preamble ] #(into (or % []) [" cljs/imul.js" ])))
1331
- (:target opts) (assoc-in [:closure-defines " cljs.core.target" ] (name (:target opts))))
1336
+ all-opts (add-implicit-options opts)
1332
1337
emit-constants (or (and (= (:optimizations opts) :advanced )
1333
1338
(not (false ? (:optimize-constants opts))))
1334
1339
(:optimize-constants opts))]
Original file line number Diff line number Diff line change 638
638
source-map-inline true }
639
639
:as opts}]
640
640
(print " To quit, type:" :cljs/quit )
641
- (let [ups-deps (cljsc/get-upstream-deps )
642
- {:keys [analyze-path repl-verbose warn-on-undeclared special-fns static-fns] :as opts
641
+ (let [{:keys [analyze-path repl-verbose warn-on-undeclared special-fns static-fns] :as opts
643
642
:or {warn-on-undeclared true }}
644
643
(merge
645
644
{:cache-analysis true :source-map true }
646
- (assoc (merge (-repl-options repl-env) opts)
647
- :init init
648
- :need-prompt prompt
649
- :flush flush
650
- :read read
651
- :print print
652
- :caught caught
653
- :reader reader
654
- :print-no-newline print-no-newline
655
- :source-map-inline source-map-inline
656
- :output-dir (or (:output-dir opts)
657
- (:default-output-dir repl-env))
658
- :ups-libs (:libs ups-deps)
659
- :ups-foreign-libs (:foreign-libs ups-deps)))]
645
+ (cljsc/add-implicit-options
646
+ (assoc (merge (-repl-options repl-env) opts)
647
+ :init init
648
+ :need-prompt prompt
649
+ :flush flush
650
+ :read read
651
+ :print print
652
+ :caught caught
653
+ :reader reader
654
+ :print-no-newline print-no-newline
655
+ :source-map-inline source-map-inline
656
+ :output-dir (or (:output-dir opts)
657
+ (:default-output-dir repl-env)))))]
660
658
(env/with-compiler-env
661
659
(or (::env/compiler repl-env) (env/default-compiler-env opts ))
662
660
(binding [ana/*cljs-ns* 'cljs.user
You can’t perform that action at this time.
0 commit comments