Skip to content

Commit 02b7ead

Browse files
committed
CLJS-3398: Docstring of with-redefs should mention usage of ^:dynamic in production
1 parent 64be690 commit 02b7ead

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/clojure/cljs/core.cljc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2257,7 +2257,11 @@
22572257
temp-value-exprs will be evaluated and each resulting value will
22582258
replace in parallel the root value of its var. After the body is
22592259
executed, the root values of all the vars will be set back to their
2260-
old values. Useful for mocking out functions during testing."
2260+
old values. Useful for mocking out functions during testing.
2261+
2262+
Note that under advanced compilation vars are statically resolved,
2263+
preventing with-redef usage. If var redefinition is desired in a production
2264+
setting then the var to be redefined must be declared ^:dynamic."
22612265
[bindings & body]
22622266
(core/let [names (take-nth 2 bindings)
22632267
vals (take-nth 2 (drop 1 bindings))

0 commit comments

Comments
 (0)