Skip to content

Commit 678f0f4

Browse files
Fix unreachable code warning in validate-inputs (#837)
The doseq macro expands into a loop with recur, so a throw in the body makes the continuation unreachable. Replace with some + throw to avoid the Closure Compiler advanced-compilation warning. Fixes #827
1 parent 71de219 commit 678f0f4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/re_frame/flow/alpha.cljc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@
6060
flows))
6161

6262
(defn validate-inputs [{:keys [inputs]}]
63-
(doseq [[_ input] inputs
64-
:when (not ((some-fn db-path? flow<-?) input))]
63+
(when (some (fn [[_ input]]
64+
(not ((some-fn db-path? flow<-?) input)))
65+
inputs)
6566
(throw (#?(:clj Exception. :cljs js/Error.) "bad input"))))
6667

6768
(defn warn-stale-dependencies [flows new-flow]

0 commit comments

Comments
 (0)