Browse files

CLJS-602: Better error message: Too many arguments to def

  • Loading branch information...
1 parent d6992aa commit ef111e88e4218e4984de454c2f04400c1f22510b @jonase jonase committed with swannodette Oct 8, 2013
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/clj/cljs/analyzer.clj
@@ -339,6 +339,9 @@
ns-name (-> env :ns :name)]
(when (namespace sym)
(throw (error env "Can't def ns-qualified name")))
+ (when-let [doc (:doc args)]
+ (when-not (string? doc)
+ (throw (error env "Too many arguments to def"))))
(let [env (if (or (and (not= ns-name 'cljs.core)
(core-name? env sym))
(get-in @namespaces [ns-name :uses sym]))

0 comments on commit ef111e8

Please sign in to comment.