Permalink
Browse files

fix read-keyword for IE

  • Loading branch information...
1 parent 50996d2 commit 3966abb10f71764b0c92487b7f165e9bafe93eb6 @wilkes wilkes committed with swannodette Nov 20, 2011
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/cljs/cljs/reader.cljs
@@ -254,13 +254,14 @@ nil if the end of stream has been reached")
(defn read-keyword
[reader initch]
(let [token (read-token reader (read-char reader))
- [token ns name] (re-matches symbol-pattern token)]
- (if (or (and (not (undefined? ns))
+ [token ns name] (re-matches symbol-pattern token)
+ ns? (and (not (undefined? ns)) (> (.length ns) 0))]
+ (if (or (and ns?
(identical? (. ns (substring (- (.length ns) 2) (.length ns))) ":/"))
(identical? (aget name (dec (.length name))) ":")
(not (== (.indexOf token "::" 1) -1)))
(reader-error reader "Invalid token: " token)
- (if (not (undefined? ns))
+ (if ns?
(keyword (.substring ns 0 (.indexOf ns "/")) name)
(keyword token)))))

0 comments on commit 3966abb

Please sign in to comment.