Skip to content

Commit 8ddfb80

Browse files
committed
CLJS-1414: Only munge @param @return if type checking
1 parent f7f8375 commit 8ddfb80

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/main/clojure/cljs/compiler.cljc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,11 @@
549549

550550
:else line))
551551

552+
(defn checking-types? []
553+
(#{:error :warn}
554+
(get-in @env/*compiler*
555+
[:options :closure-warnings :check-types])))
556+
552557
(defn emit-comment
553558
"Emit a nicely formatted comment string."
554559
([doc jsdoc]
@@ -558,7 +563,9 @@
558563
docs (if jsdoc (concat docs jsdoc) docs)
559564
docs (remove nil? docs)]
560565
(letfn [(print-comment-lines [e]
561-
(let [[x & ys] (map #(munge-param-return env %) (string/split-lines e))]
566+
(let [[x & ys]
567+
(map #(if (checking-types?) (munge-param-return env %) %)
568+
(string/split-lines e))]
562569
(emitln " * " (string/replace x "*/" "* /"))
563570
(doseq [next-line ys]
564571
(emitln " * "

0 commit comments

Comments
 (0)