Browse files

CLJS-363: `format` %s behavior is incorrect for keyword, symbol etc.

  • Loading branch information...
1 parent df6f316 commit bf0622a594473c9a6de57fe3b5d10e0419fc7a2a David Nolen committed Aug 30, 2012
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/cljs/cljs/core.cljs
@@ -1445,10 +1445,17 @@ reduces them without incurring seq initialization"
([s start] (.substring s start))
([s start end] (.substring s start end)))
+(declare map)
(defn format
"Formats a string using goog.string.format."
[fmt & args]
- (apply gstring/format fmt args))
+ (let [args (map (fn [x]
+ (if (or (keyword? x) (symbol? x))
+ (str x)
+ x))
+ args)]
+ (apply gstring/format fmt args)))
(defn symbol
"Returns a Symbol with the given namespace and name."

0 comments on commit bf0622a

Please sign in to comment.