File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 18871887 ks (map keyword fields)
18881888 getters (map (core/fn [k] `(~k ~ms)) ks)]
18891889 `(defn ~fn-name ~docstring [~ms]
1890- (new ~rname ~@getters nil (not-empty (dissoc ~ms ~@ks)) nil ))))
1890+ (let [extmap# (cond->> (dissoc ~ms ~@ks)
1891+ (record? ~ms) (into {}))]
1892+ (new ~rname ~@getters nil (not-empty extmap#) nil )))))
18911893
18921894(core/defmacro defrecord
18931895 " (defrecord name [fields*] options* specs*)
Original file line number Diff line number Diff line change 15861586 (is (uri? (goog.Uri. " " )))
15871587 (is (uri? (goog.Uri. " http://clojurescript.org" )))
15881588 (is (uri? (goog.Uri. " some string" )))))
1589+
1590+ (defrecord CLJS-2787 [])
1591+
1592+ (deftest test-cljs-2787
1593+ (let [x (map->CLJS-2787 {1 2 })
1594+ y (map->CLJS-2787 x)]
1595+ (= x y)))
You can’t perform that action at this time.
0 commit comments