Permalink
Browse files

* bin/cljsc: fix :refer-clojure :exclude and :use-macros :only combin…

…ation bug.
  • Loading branch information...
1 parent 7472ab9 commit aef60c2a8ee1b1c9c45171f5101343172cbb98d3 David Nolen committed Apr 4, 2012
Showing with 17 additions and 3 deletions.
  1. +1 −1 bin/cljsc
  2. +2 −1 src/clj/cljs/compiler.clj
  3. +6 −0 test/cljs/cljs/macro_test.cljs
  4. +5 −0 test/cljs/cljs/macro_test/macros.clj
  5. +3 −1 test/cljs/test_runner.cljs
View
@@ -8,7 +8,7 @@ if [ "$CLOJURESCRIPT_HOME" = "" ]; then
fi
CLJSC_CP=''
-for next in lib/*: src/clj: src/cljs; do
+for next in lib/*: src/clj: src/cljs: test/cljs; do
CLJSC_CP=$CLJSC_CP$CLOJURESCRIPT_HOME'/'$next
done
@@ -1034,7 +1034,8 @@
(defn get-expander [sym env]
(let [mvar
(when-not (or (-> env :locals sym) ;locals hide macros
- (-> env :ns :excludes sym))
+ (and (-> env :ns :excludes sym)
+ (not (-> env :ns :uses-macros sym))))
(if-let [nstr (namespace sym)]
(when-let [ns (cond
(= "clojure.core" nstr) (find-ns 'cljs.core)
@@ -0,0 +1,6 @@
+(ns cljs.macro-test
+ (:refer-clojure :exclude [==])
+ (:use-macros [cljs.macro-test.macros :only [==]]))
+
+(defn test-macros []
+ (assert (= (== 1 1) 2)))
@@ -0,0 +1,5 @@
+(ns cljs.macro-test.macros
+ (:refer-clojure :exclude [==]))
+
+(defmacro == [a b]
+ `(+ ~a ~b))
@@ -3,7 +3,8 @@
[cljs.reader-test :as reader-test]
[cljs.binding-test :as binding-test]
[cljs.ns-test :as ns-test]
- [clojure.string-test :as string-test]))
+ [clojure.string-test :as string-test]
+ [cljs.macro-test :as macro-test]))
(set! *print-fn* js/print)
@@ -12,6 +13,7 @@
(string-test/test-string)
(binding-test/test-binding)
(ns-test/test-ns)
+(macro-test/test-macros)
(println "Tests completed without exception")

0 comments on commit aef60c2

Please sign in to comment.