diff --git a/src/main/clojure/cljs/core.cljc b/src/main/clojure/cljs/core.cljc index 8ef2a3bb4b..d9da4618fa 100644 --- a/src/main/clojure/cljs/core.cljc +++ b/src/main/clojure/cljs/core.cljc @@ -755,7 +755,8 @@ (iterate (core/fn [[p b]] (if (core/== 2147483648 b) [(core/inc p) 1] - [p (core/bit-shift-left b 1)])) + [p #?(:clj (core/bit-shift-left b 1) + :cljs (core/* 2 b))])) [0 1]))) (def fast-path-protocol-partitions-count diff --git a/src/test/cljs/cljs/core_test.cljs b/src/test/cljs/cljs/core_test.cljs index a6211735a9..aff60a69c0 100644 --- a/src/test/cljs/cljs/core_test.cljs +++ b/src/test/cljs/cljs/core_test.cljs @@ -1899,6 +1899,9 @@ (defrecord C [a b c]) (defrecord A' [x]) (defrecord B' [x]) +(defrecord FooComparable [x] + IComparable + (-compare [_ o] (compare x (.-x o)))) (deftest test-records (let [fred (Person. "Fred" "Mertz") @@ -1939,7 +1942,8 @@ (is (= (set (keys (dissoc more-letters :d))) #{:a :b :c :e :f})) (is (= (set (keys (dissoc more-letters :d :e))) #{:a :b :c :f})) (is (= (set (keys (dissoc more-letters :d :e :f))) #{:a :b :c})) - (is (not= (A'. nil) (B'. nil)))))) + (is (not= (A'. nil) (B'. nil))) + (is (satisfies? IComparable (->FooComparable 1)))))) (deftype FnLike [] IFn