Skip to content
Browse files

* src/clj/cljs/closure.clj: make sure dependencies (like core.cljs) a…

…re compiled with the same *static-fns* settings as everything else
  • Loading branch information...
1 parent de72ace commit cc46b91ad41969fb57cc8bca36ca802d5778ec29 David Nolen committed May 5, 2012
Showing with 22 additions and 21 deletions.
  1. +22 −21 src/clj/cljs/closure.clj
View
43 src/clj/cljs/closure.clj
@@ -867,27 +867,28 @@
opts)
ups-deps (get-upstream-deps)
all-opts (assoc opts
- :ups-libs (:libs ups-deps)
- :ups-foreign-libs (:foreign-libs ups-deps)
- :ups-externs (:externs ups-deps))
- compiled (binding [comp/*cljs-static-fns*
- (or (and (= (opts :optimizations) :advanced))
- (:static-fns opts)
- comp/*cljs-static-fns*)]
- (-compile source all-opts))
- compiled (concat
- (if (coll? compiled) compiled [compiled])
- (when (= :nodejs (:target all-opts))
- [(-compile (io/resource "cljs/nodejscli.cljs") all-opts)]))
- js-sources (if (coll? compiled)
- (apply add-dependencies all-opts compiled)
- (add-dependencies all-opts compiled))]
- (if (:optimizations all-opts)
- (->> js-sources
- (apply optimize all-opts)
- (add-header all-opts)
- (output-one-file all-opts))
- (apply output-unoptimized all-opts js-sources))))
+ :ups-libs (:libs ups-deps)
+ :ups-foreign-libs (:foreign-libs ups-deps)
+ :ups-externs (:externs ups-deps))]
+ (binding [comp/*cljs-static-fns*
+ (or (and (= (opts :optimizations) :advanced))
+ (:static-fns opts)
+ comp/*cljs-static-fns*)]
+ (let [compiled (-compile source all-opts)
+ compiled (concat
+ (if (coll? compiled) compiled [compiled])
+ (when (= :nodejs (:target all-opts))
+ [(-compile (io/resource "cljs/nodejscli.cljs") all-opts)]))
+ js-sources (if (coll? compiled)
+ (binding []
+ (apply add-dependencies all-opts compiled))
+ (add-dependencies all-opts compiled))]
+ (if (:optimizations all-opts)
+ (->> js-sources
+ (apply optimize all-opts)
+ (add-header all-opts)
+ (output-one-file all-opts))
+ (apply output-unoptimized all-opts js-sources))))))
(comment

0 comments on commit cc46b91

Please sign in to comment.
Something went wrong with that request. Please try again.