Skip to content

Commit b79e45a

Browse files
anmonteirodnolen
authored and
dnolen
committed
CLJS-2009: Remove unnecessary code introduced by CLJS-1973
1 parent 3d2dcaf commit b79e45a

File tree

2 files changed

+5
-22
lines changed

2 files changed

+5
-22
lines changed

src/main/clojure/cljs/closure.clj

+5-8
Original file line numberDiff line numberDiff line change
@@ -1959,9 +1959,7 @@
19591959
:as opts}]
19601960
(let [opts (cond-> (update opts :foreign-libs
19611961
(fn [libs]
1962-
(into (into []
1963-
(util/distinct-merge-by :file
1964-
(index-node-modules npm-deps opts)))
1962+
(into (index-node-modules npm-deps opts)
19651963
(expand-libs libs))))
19661964
(:closure-defines opts)
19671965
(assoc :closure-defines
@@ -1981,9 +1979,7 @@
19811979
:optimizations optimizations
19821980
:output-dir output-dir
19831981
:ups-libs libs
1984-
:ups-foreign-libs (into (into []
1985-
(util/distinct-merge-by :file
1986-
(index-node-modules (compute-upstream-npm-deps opts) opts)))
1982+
:ups-foreign-libs (into (index-node-modules (compute-upstream-npm-deps opts) opts)
19871983
(expand-libs foreign-libs))
19881984
:ups-externs externs
19891985
:emit-constants emit-constants
@@ -2115,14 +2111,15 @@
21152111
(:options @env/*compiler*))))
21162112
([npm-deps opts]
21172113
(let [node-modules (io/file "node_modules")]
2118-
(when (and (not (empty? npm-deps)) (.exists node-modules) (.isDirectory node-modules))
2114+
(if (and (not (empty? npm-deps)) (.exists node-modules) (.isDirectory node-modules))
21192115
(let [modules (map name (keys npm-deps))
21202116
deps-file (io/file (str (util/output-directory opts) File/separator
21212117
"cljs$node_modules.js"))]
21222118
(util/mkdirs deps-file)
21232119
(with-open [w (io/writer deps-file)]
21242120
(run! #(.write w (str "require('" % "');\n")) modules))
2125-
(node-inputs [{:file (.getAbsolutePath deps-file)}] opts))))))
2121+
(node-inputs [{:file (.getAbsolutePath deps-file)}] opts))
2122+
[]))))
21262123

21272124
(defn process-js-modules
21282125
"Given the current compiler options, converts JavaScript modules to Google

src/main/clojure/cljs/util.cljc

-14
Original file line numberDiff line numberDiff line change
@@ -279,20 +279,6 @@
279279
xs seen)))]
280280
(step coll #{}))))
281281

282-
(defn distinct-merge-by
283-
[f & xss]
284-
(let [xf (map (fn [x]
285-
[(f x) x]))]
286-
(vals (apply merge-with
287-
(fn [a b]
288-
(merge-with
289-
(fn [a b]
290-
(cond-> a
291-
(sequential? a)
292-
(into b)))
293-
a b))
294-
(map #(into {} xf %) xss)))))
295-
296282
(defn content-sha [^String s]
297283
(let [digest (MessageDigest/getInstance "SHA-1")]
298284
(.reset digest)

0 commit comments

Comments
 (0)