Permalink
Browse files

CLJS-437: Validate arity of 'if forms

  • Loading branch information...
1 parent 7ccb67e commit 9abeb143f66ad6d92756c2dd702966f63ae76c27 @brandonbloom brandonbloom committed with David Nolen Dec 6, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 src/clj/cljs/analyzer.clj
@@ -235,6 +235,7 @@
(defmethod parse 'if
[op env [_ test then else :as form] name]
+ (assert (>= (count form) 3) "Too few arguments to if")
(let [test-expr (disallowing-recur (analyze (assoc env :context :expr) test))
then-expr (analyze env then)
else-expr (analyze env else)]

0 comments on commit 9abeb14

Please sign in to comment.