Skip to content
Browse files

Merge from master and fixed conflict

  • Loading branch information...
2 parents bc6e78c + 0df1bc4 commit 8eb8ef99d5a594db91e8538d8c398eb0d6b75a80 @fogus fogus committed Jan 13, 2012
View
3 src/clj/cljs/compiler.clj
@@ -988,7 +988,8 @@
(defn get-expander [sym env]
(let [mvar
- (when-not (-> env :locals sym) ;locals hide macros
+ (when-not (or (-> env :locals sym) ;locals hide macros
+ (-> env :ns :excludes sym))
(if-let [nstr (namespace sym)]
(when-let [ns (cond
(= "clojure.core" nstr) (find-ns 'cljs.core)
View
2 src/clj/cljs/core.clj
@@ -406,7 +406,7 @@
[bindings & body]
(let [names (take-nth 2 bindings)
vals (take-nth 2 (drop 1 bindings))
- tempnames (map gensym names)
+ tempnames (map (comp gensym name) names)
binds (map vector names vals)
resets (reverse (map vector names tempnames))]
`(let [~@(interleave tempnames names)]
View
2 src/cljs/cljs/reader.cljs
@@ -250,7 +250,7 @@ nil if the end of stream has been reached")
(let [token (read-token reader initch)]
(if (gstring/contains token "/")
(symbol (subs token 0 (.indexOf token "/"))
- (subs (inc (.indexOf token "/")) (.-length token)))
+ (subs token (inc (.indexOf token "/")) (.-length token)))
(get special-symbols token (symbol token)))))
(defn read-keyword
View
7 test/cljs/cljs/binding_test.cljs
@@ -0,0 +1,7 @@
+(ns cljs.binding-test
+ (:require [cljs.binding-test-other-ns :as o]))
+
+(defn test-binding []
+ (binding [o/*foo* 2]
+ (assert (= o/*foo* 2)))
+ (assert (= o/*foo* 1)))
View
3 test/cljs/cljs/binding_test_other_ns.cljs
@@ -0,0 +1,3 @@
+(ns cljs.binding-test-other-ns)
+
+(def *foo* 1)
View
10 test/cljs/cljs/ns_test.cljs
@@ -0,0 +1,10 @@
+(ns cljs.ns-test
+ (:refer-clojure :exclude [+]))
+
+(def + -)
+
+(defn test-ns []
+ (assert (= 4 (clojure.core/+ 2 1 1)))
+ (assert (= 0 (cljs.ns-test/+ 2 1 1)))
+ (assert (= 0 (+ 2 1 1)))
+ :ok)
View
3 test/cljs/cljs/reader_test.cljs
@@ -15,6 +15,7 @@
(assert (= '(7 8 9) (reader/read-string "(7 8 9)")))
(assert (= '(deref foo) (reader/read-string "@foo")))
(assert (= '(quote bar) (reader/read-string "'bar")))
+ (assert (= 'foo/bar (reader/read-string "foo/bar")))
(assert (= \a (reader/read-string "\\a")))
(assert (= {:tag 'String} (meta (reader/read-string "^String {:a 1}"))))
(assert (= [:a 'b #{'c {:d [:e :f :g]}}]
@@ -25,5 +26,5 @@
(assert (= false (reader/read-string "false")))
(assert (= "string" (reader/read-string "\"string\"")))
(assert (= "escape chars \t \r \n \\ \" \b \f" (reader/read-string "\"escape chars \\t \\r \\n \\\\ \\\" \\b \\f\"")))
-
+
:ok)
View
4 test/cljs/test_runner.cljs
@@ -1,13 +1,17 @@
(ns test-runner
(:require [cljs.core-test :as core-test]
[cljs.reader-test :as reader-test]
+ [cljs.binding-test :as binding-test]
+ [cljs.ns-test :as ns-test]
[clojure.string-test :as string-test]))
(set! *print-fn* js/print)
(core-test/test-stuff)
(reader-test/test-reader)
(string-test/test-string)
+(binding-test/test-binding)
+(ns-test/test-ns)
(println "Tests completed without exception")

0 comments on commit 8eb8ef9

Please sign in to comment.
Something went wrong with that request. Please try again.