File tree 2 files changed +10
-1
lines changed
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 1887
1887
ks (map keyword fields)
1888
1888
getters (map (core/fn [k] `(~k ~ms)) ks)]
1889
1889
`(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 )))))
1891
1893
1892
1894
(core/defmacro defrecord
1893
1895
" (defrecord name [fields*] options* specs*)
Original file line number Diff line number Diff line change 1586
1586
(is (uri? (goog.Uri. " " )))
1587
1587
(is (uri? (goog.Uri. " http://clojurescript.org" )))
1588
1588
(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