Skip to content

Commit

Permalink
macro checking support
Browse files Browse the repository at this point in the history
  • Loading branch information
dnolen committed Jun 1, 2016
1 parent f75687f commit d644079
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/clojure/cljs/analyzer.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -2361,7 +2361,11 @@
(if-not (nil? mac-var)
(#?@(:clj [binding [*ns* (create-ns *cljs-ns*)]]
:cljs [do])
(let [form' (try
(let [mchk #?(:clj (some-> (find-ns 'clojure.spec)
(ns-resolve 'macroexpand-check)))
_ #?(:clj (when mchk
(mchk mac-var (next form))))
form' (try
(apply @mac-var form env (rest form))
#?(:clj (catch ArityException e
(throw (ArityException. (- (.actual e) 2) (.name e))))))]
Expand Down

0 comments on commit d644079

Please sign in to comment.