(#1695) Respect priority when merging defaults

This commit adds an extra condition at the beginning of the
`setup-map-defaults` function, such that if one of the two
items being merged has a higher priority than the other,
it is honored.

This seems to fix the issue where the `^:replace` metadata
was not working properly
This commit is contained in:
Chris Price 2014-10-18 15:44:54 -07:00
parent 1354f15877
commit 403e96a51e

View file

@ -319,7 +319,8 @@
(fn [left right]
;; Assumes that left always contains :reduce OR :prepend in its meta
(with-meta
(cond (-> left meta :reduce) (-> left meta :reduce
(cond (different-priority? left right) (pick-prioritized left right)
(-> left meta :reduce) (-> left meta :reduce
(reduce left right))
(-> left meta :prepend) (concat right left))
(merge (meta left)