macro | previously cljs.spec.test/with-instrument-disabled | ![]() | Edit |
(with-instrument-disabled & body)
Disables instrument's checking of calls, within a scope.
(defmacro with-instrument-disabled
[& body]
;; Note: In order to read the value of this private var, we employ interop
;; rather than derefing a var special. This eases specing core functions
;; (and infinite recursion) by avoiding code generated by the var special,
;; and also produces more compact / efficient code.
`(let [orig# (.-*instrument-enabled* js/cljs.spec.test.alpha)]
(set! *instrument-enabled* nil)
(try
~@body
(finally
(set! *instrument-enabled* orig#)))))