Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…ation bug.
  • Loading branch information...
commit aef60c2a8ee1b1c9c45171f5101343172cbb98d3 1 parent 7472ab9
David Nolen authored
View
2  bin/cljsc
@@ -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
View
3  src/clj/cljs/compiler.clj
@@ -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)
View
6 test/cljs/cljs/macro_test.cljs
@@ -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)))
View
5 test/cljs/cljs/macro_test/macros.clj
@@ -0,0 +1,5 @@
+(ns cljs.macro-test.macros
+ (:refer-clojure :exclude [==]))
+
+(defmacro == [a b]
+ `(+ ~a ~b))
View
4 test/cljs/test_runner.cljs
@@ -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")
Please sign in to comment.
Something went wrong with that request. Please try again.