Skip to content

Commit 711ec34

Browse files
faviladnolen
authored andcommitted
CLJS-2111: Transit analysis caching broken for JSValue or regex
Transit read-handler and write-handler functions have the wrong arity: they do not receive the WriteHandler or ReadHandler as an argument, only the object or form itself.
1 parent 293b7dd commit 711ec34

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/main/clojure/cljs/analyzer.cljc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@
7070
read-handler-map @(ns-resolve ns 'read-handler-map)]
7171
{:handlers
7272
(read-handler-map
73-
{"cljs/js" (read-handler (fn [_ v] (JSValue. v)))
74-
"cljs/regex" (read-handler (fn [_ v] (Pattern/compile v)))})}))
73+
{"cljs/js" (read-handler (fn [v] (JSValue. v)))
74+
"cljs/regex" (read-handler (fn [v] (Pattern/compile v)))})}))
7575
(catch Throwable t
7676
nil))))
7777

@@ -86,12 +86,12 @@
8686
(write-handler-map
8787
{JSValue
8888
(write-handler
89-
(fn [_ _] "cljs/js")
90-
(fn [_ js] (.val ^JSValue js)))
89+
(fn [_] "cljs/js")
90+
(fn [js] (.val ^JSValue js)))
9191
Pattern
9292
(write-handler
93-
(fn [_ _] "cljs/regex")
94-
(fn [_ pat] (.pattern ^Pattern pat)))})}))
93+
(fn [_] "cljs/regex")
94+
(fn [pat] (.pattern ^Pattern pat)))})}))
9595
(catch Throwable t
9696
nil))))
9797

0 commit comments

Comments
 (0)