Skip to content

Commit 8f1f977

Browse files
mfikesswannodette
authored andcommitted
CLJS-1660: cljs.spec: Always return var from instrument / unstrument
1 parent 2a21c22 commit 8f1f977

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/main/cljs/cljs/spec.cljc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -385,17 +385,19 @@ specified, return speced vars from all namespaces."
385385
[v]
386386
(let [v (if-not (seq? v) (list 'var v) v)
387387
sym (second v)]
388-
`(when-let [checked# (cljs.spec/instrument* ~v)]
389-
(set! ~sym checked#)
388+
`(do
389+
(when-let [checked# (cljs.spec/instrument* ~v)]
390+
(set! ~sym checked#))
390391
~v)))
391392

392393
(defmacro unstrument
393394
"Undoes instrument on the var at v, a var or symbol. Idempotent."
394395
[v]
395396
(let [v (if-not (seq? v) (list 'var v) v)
396397
sym (second v)]
397-
`(when-let [raw# (cljs.spec/unstrument* ~v)]
398-
(set! ~sym raw#)
398+
`(do
399+
(when-let [raw# (cljs.spec/unstrument* ~v)]
400+
(set! ~sym raw#))
399401
~v)))
400402

401403
(defmacro instrument-ns

0 commit comments

Comments
 (0)