Skip to content

Commit

Permalink
CLJS-1131: cljs.closure/add-dependencies needs to be more aggressivel…
Browse files Browse the repository at this point in the history
…y set oriented
  • Loading branch information
dnolen committed Mar 16, 2015
1 parent 7a6ce7f commit 9a276fb
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/clj/cljs/closure.clj
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ should contain the source for the given namespace name."
(recur (into (rest required-files) new-req)
(into visited new-req)
(conj js-deps js)))
(remove nil? js-deps)))))
(disj js-deps nil)))))

(comment
;; only get cljs deps
Expand All @@ -539,11 +539,13 @@ should contain the source for the given namespace name."
a new sequence of IJavaScript objects which includes the input list
plus all dependencies in dependency order."
[opts & inputs]
(let [requires (mapcat deps/-requires inputs)
required-cljs (remove (set inputs) (cljs-dependencies opts requires))
required-js (js-dependencies opts (set (concat (mapcat deps/-requires required-cljs) requires)))
provided (mapcat deps/-provides (concat inputs required-cljs required-js))
unprovided (clojure.set/difference (set requires) (set provided) #{"constants-table"})]
(let [inputs (set inputs)
requires (set (mapcat deps/-requires inputs))
required-cljs (clojure.set/difference (cljs-dependencies opts requires) inputs)
required-js (js-dependencies opts
(into (set (mapcat deps/-requires required-cljs)) requires))
provided (set (mapcat deps/-provides (clojure.set/union inputs required-cljs required-js)))
unprovided (clojure.set/difference requires provided #{"constants-table"})]
(when (seq unprovided)
(ana/warning :unprovided @env/*compiler* {:unprovided (sort unprovided)}))
(cons
Expand Down

0 comments on commit 9a276fb

Please sign in to comment.