diff --git a/src/portal/runtime/cson.cljc b/src/portal/runtime/cson.cljc index 0f0f0a86..017deb47 100644 --- a/src/portal/runtime/cson.cljc +++ b/src/portal/runtime/cson.cljc @@ -754,11 +754,14 @@ :cljr clojure.lang.TaggedLiteral :cljs TaggedLiteral) ToJson - (-to-json [value buffer] + (-to-json [{:keys [tag form]} buffer] (-> buffer (json/push-string "tag") - (json/push-string (name (:tag value))) - (to-json (:form value))))) + (json/push-string + (if-let [ns (namespace tag)] + (str ns "/" (name tag)) + (name tag))) + (to-json form)))) (defn- ->tagged-literal [buffer] (tagged-literal (symbol (json/next-string buffer)) (->value buffer))) diff --git a/test/portal/runtime/cson_test.cljc b/test/portal/runtime/cson_test.cljc index e556f1bd..df7c8395 100644 --- a/test/portal/runtime/cson_test.cljc +++ b/test/portal/runtime/cson_test.cljc @@ -131,11 +131,12 @@ #?(:clj (UUID/randomUUID) :cljr (Guid/NewGuid) :cljs (random-uuid)) - (tagged-literal 'tag :value)]) + (tagged-literal 'tag :value) + (tagged-literal 'ns/tag :value)]) (deftest tagged-objects (doseq [value tagged] - (is (= (pass value) (pass value))))) + (is (= (pass value) value)))) (defn meta* [v] #?(:bb (dissoc (meta v) :type) :cljr (meta v) :clj (meta v) :cljs (meta v)))