Skip to content

Commit dfad0d2

Browse files
mfikesdnolen
authored and
dnolen
committed
CLJS-1293: Warning settings not conveyed via REPL
Sets the binding for ana/*cljs-warnings* so that it reflects any warnings supplied in opts.
1 parent 8537ef4 commit dfad0d2

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

src/main/clojure/cljs/repl.cljc

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -767,11 +767,19 @@
767767
ana/*cljs-ns* ana/*cljs-ns*
768768
*cljs-verbose* repl-verbose
769769
ana/*cljs-warnings*
770-
(assoc ana/*cljs-warnings*
771-
:unprovided warn-on-undeclared
772-
:undeclared-var warn-on-undeclared
773-
:undeclared-ns warn-on-undeclared
774-
:undeclared-ns-form warn-on-undeclared)
770+
(let [warnings (opts :warnings true)]
771+
(merge
772+
ana/*cljs-warnings*
773+
(if (or (true? warnings)
774+
(false? warnings))
775+
(zipmap (keys ana/*cljs-warnings*) (repeat warnings))
776+
warnings)
777+
(zipmap
778+
[:unprovided :undeclared-var
779+
:undeclared-ns :undeclared-ns-form]
780+
(repeat (if (false? warnings)
781+
false
782+
warn-on-undeclared)))))
775783
ana/*cljs-static-fns* static-fns
776784
*repl-opts* opts]
777785
(let [env {:context :expr :locals {}}

0 commit comments

Comments
 (0)