Skip to content

Commit 71f5771

Browse files
committed
CLJS-2906: cljs.main: Crash when with default REPL
repl-name name helper needs to handle case where :ns is nil
1 parent 0e31a09 commit 71f5771

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/clojure/cljs/cli.clj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,9 @@ is trying load some arbitrary ns."
290290
(util/path f)))
291291

292292
(defn- repl-name [repl-env]
293-
(subs (-> repl-env meta :ns str) (count "cljs.repl.")))
293+
(let [repl-ns (-> repl-env meta :ns str)]
294+
(when (string/starts-with? repl-ns "cljs.repl.")
295+
(subs repl-ns (count "cljs.repl.")))))
294296

295297
(defn- fast-initial-prompt? [repl-env inits]
296298
(and (empty? inits)

0 commit comments

Comments
 (0)