Skip to content

Commit f744e79

Browse files
author
dnolen
committed
same as Clojure 30dd3d8
1 parent 623f563 commit f744e79

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

src/main/cljs/cljs/spec.cljc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,8 @@ specified, return speced vars from all namespaces."
393393

394394
(defmacro instrument
395395
"Instruments the var at v, a var or symbol, to check specs
396-
registered with fdef. Wraps the fn at v to check :args/:ret/:fn
397-
specs, if they exist, throwing an ex-info with explain-data if a
396+
registered with fdef. Wraps the fn at v to check :args
397+
spec, if it exist, throwing an ex-info with explain-data if a
398398
check fails. Idempotent."
399399
[v]
400400
(let [v (if-not (seq? v) (list 'var v) v)

src/main/cljs/cljs/spec.cljs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -293,13 +293,9 @@
293293
(if *instrument-enabled*
294294
(s/with-instrument-disabled
295295
(let [specs (fn-spec v)]
296-
(let [cargs (when (:args specs) (conform! v :args (:args specs) args args))
297-
ret (binding [*instrument-enabled* true]
298-
(apply f args))
299-
cret (when (:ret specs) (conform! v :ret (:ret specs) ret args))]
300-
(when (c/and (:args specs) (:ret specs) (:fn specs))
301-
(conform! v :fn (:fn specs) {:args cargs :ret cret} args))
302-
ret)))
296+
(when (:args specs) (conform! v :args (:args specs) args args))
297+
(binding [*instrument-enabled* true]
298+
(apply f args))))
303299
(apply f args)))
304300
(not (instance? MultiFn f)) (doto (gobj/extend f)))))
305301

0 commit comments

Comments
 (0)