Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

CLJS-480: reader/*data-readers* bound inconsistently

Stop binding reader/*data-readers* haphazardly. Instead bind it to
cljs.tagged-literals/*cljs-data-readesr* only in cljs.analyzer/forms-seq
and make sure to actually capture its value to avoid lazy-seq issues.
  • Loading branch information...
commit a1514b18d1367295b7dd0405591e5fa5b580c529 1 parent 3912cfd
@swannodette swannodette authored
View
5 src/clj/cljs/analyzer.clj
@@ -1425,12 +1425,15 @@
argument, which the reader will use in any emitted errors."
([f] (forms-seq f (source-path f)))
([f filename]
- (let [rdr (readers/indexing-push-back-reader (java.io.PushbackReader. (io/reader f)) 1 filename)
+ (let [rdr (readers/indexing-push-back-reader
+ (java.io.PushbackReader. (io/reader f)) 1 filename)
+ data-readers tags/*cljs-data-readers*
forms-seq*
(fn forms-seq* []
(lazy-seq
(let [eof-sentinel (Object.)
form (binding [*ns* (create-ns *cljs-ns*)
+ reader/*data-readers* data-readers
reader/*alias-map*
(apply merge
((juxt :requires :require-macros)
View
1  src/clj/cljs/compiler.clj
@@ -849,7 +849,6 @@
ana/*cljs-ns* 'cljs.user
ana/*cljs-file* (.getPath ^File src)
reader/*alias-map* (or reader/*alias-map* {})
- reader/*data-readers* tags/*cljs-data-readers*
*source-map-data* (when (:source-map opts)
(atom
{:source-map (sorted-map)
View
31 src/clj/cljs/repl.clj
@@ -176,24 +176,23 @@
(print (str "ClojureScript:" ana/*cljs-ns* "> "))
(flush)
(let [form (try
- (binding [*data-readers* tags/*cljs-data-readers*]
- (if (seq forms)
- (first forms)
- :cljs/quit))
+ (if (seq forms)
+ (first forms)
+ :cljs/quit)
(catch Exception e
(println (.getMessage e))
read-error))]
(cond
- (identical? form read-error) (recur (ana/forms-seq *in* "NO_SOURCE_FILE"))
-
- (= form :cljs/quit) :quit
-
- (and (seq? form) (is-special-fn? (first form)))
- (do (apply (get special-fns (first form)) repl-env (rest form))
- (newline)
- (recur (rest forms)))
-
- :else
- (do (eval-and-print repl-env env form)
- (recur (rest forms))))))
+ (identical? form read-error) (recur (ana/forms-seq *in* "NO_SOURCE_FILE"))
+
+ (= form :cljs/quit) :quit
+
+ (and (seq? form) (is-special-fn? (first form)))
+ (do (apply (get special-fns (first form)) repl-env (rest form))
+ (newline)
+ (recur (rest forms)))
+
+ :else
+ (do (eval-and-print repl-env env form)
+ (recur (rest forms))))))
(-tear-down repl-env)))))
Please sign in to comment.
Something went wrong with that request. Please try again.