Skip to content

Commit 8ed20cc

Browse files
authored
Merge pull request #113 from clojure/cljs-3341/windows-loader-test-overflow
CLJS-3341: Windows loader test failing with StackOverflow
2 parents f2cb378 + 85d4bca commit 8ed20cc

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

src/main/clojure/cljs/compiler.cljc

+5-5
Original file line numberDiff line numberDiff line change
@@ -1618,11 +1618,11 @@
16181618
{:ns (or ns-name 'cljs.user)
16191619
:macros-ns (:macros-ns opts)
16201620
:provides [ns-name]
1621-
:requires (cond-> (distinct deps)
1622-
(get-in @env/*compiler* [:options :emit-constants])
1623-
(conj ana/constants-ns-sym)
1624-
(not= ns-name 'cljs.core)
1625-
(conj 'cljs.core))
1621+
:requires (if (= ns-name 'cljs.core)
1622+
(vec (distinct deps))
1623+
(cond-> (conj (vec (distinct deps)) 'cljs.core)
1624+
(get-in @env/*compiler* [:options :emit-constants])
1625+
(conj ana/constants-ns-sym)))
16261626
:file dest
16271627
:out-file (.toString ^File dest)
16281628
:source-file src}

src/main/clojure/cljs/module_graph.cljc

+7-2
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,13 @@
148148
"Return all dependencies for x in a graph using deps-key."
149149
[x graph deps-key]
150150
(let [requires (get-in graph [x deps-key])]
151-
(-> (mapcat #(deps-for % graph deps-key) requires)
152-
(concat requires) distinct vec)))
151+
(try
152+
(-> (mapcat #(deps-for % graph deps-key) requires)
153+
(concat requires) distinct vec)
154+
(catch Throwable t
155+
(throw
156+
(ex-info (str "Failed to compute deps for " x)
157+
{:lib x :requires requires} t))))))
153158

154159
(defn deps-for-entry
155160
"Return all dependencies for an entry using a compiler inputs index."

0 commit comments

Comments
 (0)