Is this a bug or by design? It seems like CLJS reader cannot read regular expressions:
(cljs.reader/read-string (pr-str #"a"))
error {:message "EOF while reading.", :data {:type :reader-exception, :ex-kind :eof}}
Clojurescript v1.9.908
UPDATE: It works with v1.9.229 and Clojure 1.8.0. I'll try to see which version broke that...
cljs.reader/read-string only reads data in edn format & clojure regular expression #"..." syntax is not part of edn specification. (see http://edn-format.org)
https://cljs.github.io/api/cljs.reader/read-string
Reads one object from the string s. Returns nil when s is nil or empty.
Reads data in the edn format (subset of Clojure data): http://edn-format.org
opts is a map as per cljs.tools.reader.edn/read
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With