Skip to content

Commit f2cb378

Browse files
committed
CLJS-3334: exists? evaluates to true for cljs.user//
1 parent 04b2107 commit f2cb378

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/main/clojure/cljs/core.cljc

+1-1
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,7 @@
973973
(if (core/symbol? x)
974974
(core/let [x (core/cond-> (:name (cljs.analyzer/resolve-var &env x))
975975
(= "js" (namespace x)) name)
976-
segs (string/split (core/str (string/replace (core/str x) "/" ".")) #"\.")
976+
segs (string/split (core/str (string/replace-first (core/str x) "/" ".")) #"\.")
977977
n (count segs)
978978
syms (map
979979
#(vary-meta (symbol "js" (string/join "." %))

src/test/cljs/cljs/core_test.cljs

+5
Original file line numberDiff line numberDiff line change
@@ -1878,3 +1878,8 @@
18781878
(deftest test-cljs-3333
18791879
(defonce not-native 17) ;; Intentionally matching a core name
18801880
(is (== 17 not-native)))
1881+
1882+
(deftest test-cljs-3334
1883+
(is (exists? /))
1884+
(is (exists? cljs.core//))
1885+
(is (not (exists? cljs.core-test//))))

0 commit comments

Comments
 (0)