Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

symbol's :else clause was outside the cond expr, breaking behavior. f…

…ix + test.
  • Loading branch information...
commit 4088ec6f66f6802f31a6b2f4ccfbfb4e8f20ef47 1 parent c8e301a
David Nolen authored
Showing with 8 additions and 3 deletions.
  1. +5 −3 src/cljs/cljs/core.cljs
  2. +3 −0  test/cljs/cljs/core_test.cljs
View
8 src/cljs/cljs/core.cljs
@@ -1473,9 +1473,11 @@ reduces them without incurring seq initialization"
(defn symbol
"Returns a Symbol with the given namespace and name."
- ([name] (cond (symbol? name) name
- (keyword? name) (str* "\uFDD1" "'" (subs name 2)))
- :else (str* "\uFDD1" "'" name))
+ ([name]
+ (cond
+ (symbol? name) name
+ (keyword? name) (str* "\uFDD1" "'" (subs name 2))
+ :else (str* "\uFDD1" "'" name)))
([ns name] (symbol (str* ns "/" name))))
(defn keyword
View
3  test/cljs/cljs/core_test.cljs
@@ -211,6 +211,9 @@
(assert (= "hello:world" (str "hello" :world)))
(assert (= ":helloworld" (str :hello 'world)))
+ ; symbol
+ (assert (= 'a (symbol 'a)))
+
;; format
(assert (= "01: 2.000000" (format "%02d: %.6f" 1 2)))
Please sign in to comment.
Something went wrong with that request. Please try again.