Skip to content

Commit

Permalink
CLJS-602: Better error message: Too many arguments to def
Browse files Browse the repository at this point in the history
  • Loading branch information
jonase authored and swannodette committed Oct 8, 2013
1 parent d6992aa commit ef111e8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/clj/cljs/analyzer.clj
Expand Up @@ -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]))
Expand Down

0 comments on commit ef111e8

Please sign in to comment.