x/sort-by bug in CLJS
den1k opened this issue · comments
Dennis Heihoff commented
This only happens in CLJS
(= (sort-by identity > (shuffle (range 100)))
(into [] (x/sort-by identity >) (shuffle (range 100))))
;; => false
Input is returned unchanged:
(into [] (x/sort-by identity >) [3 2 0 4 8 5 6 7 1 9])
;; => [3 2 0 4 8 5 6 7 1 9]
Dennis Heihoff commented
This works in CLJ and CLJS:
(into [] (x/sort-by identity (comparator >)) [3 2 0 4 8 5 6 7 1 9])
;; => [9 8 7 6 5 4 3 2 1 0]
Rangel Spasov commented
This seems to work in CLJS for me (running on JavaScript core, iOS):
(into [] (x/sort-by identity >) [3 2 0 4 8 5 6 7 1 9])
; => [0 1 2 3 4 5 6 7 8 9]
@den1k is this still an issue for you?
Dennis Heihoff commented
I don't have CLJS REPL handy right now but the environment was the browser. I'm not sure if anything changed in CLJS core or xforms to fix the bug
Dennis Heihoff commented
thanks for fixing this!