We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8db5b76 commit 1c2094cCopy full SHA for 1c2094c
src/main/clojure/cljs/analyzer/api.cljc
@@ -61,6 +61,16 @@
61
[warning-type env extra]
62
(ana/default-warning-handler warning-type env extra))
63
64
+(defmacro with-warning-handlers
65
+ "Helper macro for custom handling of emitted warnings. Handlers should be
66
+ a vector of functions. The signature of these functions is
67
+ [warn-type env warn-info]. warn-type is a keyword describing the warning,
68
+ env is the analysis environment, and warn-info is a map of extra useful
69
+ information for a particular warning type."
70
+ [handlers & body]
71
+ `(ana/with-warning-handlers ~handlers
72
+ ~@body))
73
+
74
(defn get-options
75
"Return the compiler options from compiler state."
76
([] (get-options (current-state)))
0 commit comments