Browse files

CLJS-328: fix :require spec handling in ns

Fixes singleton vector handling in :require specs so that all specs in
the following snippet are equivalent:

(ns foo
  (:require [bar.quux :as bar.quux]
  • Loading branch information...
1 parent c60df78 commit 8365d2a8202a429a907450a54c10dd067096f87f @michalmarczyk michalmarczyk committed with David Nolen Jun 28, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/clj/cljs/analyzer.clj
@@ -606,9 +606,9 @@
(<= (fs :refer 0) 1)))
(error-msg spec "Each of :as and :refer options may only be specified once in :require / :require-macros")))
(if (symbol? spec)
- (recur macros? [spec :as spec])
+ (recur macros? [spec])
(let [[lib & opts] spec
- {alias :as referred :refer} (apply hash-map opts)
+ {alias :as referred :refer :or {alias lib}} (apply hash-map opts)
[rk uk] (if macros? [:require-macros :use-macros] [:require :use])]
(assert (or (symbol? alias) (nil? alias))
(error-msg spec ":as must be followed by a symbol in :require / :require-macros"))

0 comments on commit 8365d2a

Please sign in to comment.