Skip to content

Commit d60d204

Browse files
committed
Fully qualify loop
1 parent 8ce63ee commit d60d204

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/sci/impl/utils.cljc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
("clojure.core" "cljs.core") (symbol (name sym))
162162
sym))
163163

164-
(def allowed-loop (symbol "loop"))
164+
(def allowed-loop (symbol "clojure.core/loop"))
165165
(def allowed-recur (symbol "recur"))
166166
(def var-unbound #?(:clj (Object.)
167167
:cljs (js/Object.)))

test/sci/core_test.cljc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,12 @@
745745
" {})))
746746
(is (= 1 (tu/eval* "
747747
(let [let 1] (loop [x 1] x))"
748+
{})))
749+
(is (= [1 2 3] (tu/eval* "
750+
(ns exclude-loop (:refer-clojure :exclude [loop]))
751+
(def state (atom []))
752+
(doseq [i [1 2 3]] (swap! state conj i))
753+
@state"
748754
{}))))
749755

750756
(deftest for-test

0 commit comments

Comments
 (0)