File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -7448,7 +7448,7 @@ reduces them without incurring seq initialization"
74487448 " keyval => key val
74497449 Returns a new array map with supplied mappings."
74507450 [& keyvals]
7451- (let [arr (if (instance? IndexedSeq keyvals)
7451+ (let [arr (if (and ( instance? IndexedSeq keyvals) ( zero? ( .-i keyvals)) )
74527452 (.-arr keyvals)
74537453 (into-array keyvals))]
74547454 (.fromArray cljs.core/PersistentArrayMap arr true false )))
Original file line number Diff line number Diff line change 26862686(defn foo-set [x]
26872687 (first x))
26882688
2689- (deftest test-cljs-982-var-deref []
2689+ (deftest test-cljs-982-var-deref
26902690 (let [f (foo-var #'foo-set)]
26912691 (is (= (f [1 2 3 ]) 1 ))
26922692 (set! foo-set (fn [x] :oops ))
27312731 :foo #'foo-1187
27322732 :bar #'bar-1187) []))
27332733
2734- (deftest test-cljs-1187 []
2734+ (deftest test-cljs-1187
27352735 (testing " Internal var nodes analyzed in expression context"
27362736 (is (= (with-out-str (print-foo-1187 :foo ))
27372737 " foo!" ))))
27382738
2739- (deftest test-cljs-1189 []
2739+ (deftest test-cljs-1189
27402740 (testing " array-map should always return array maps"
27412741 (let [am (apply array-map (range 100 ))]
27422742 (is (== (count am) 50 ))
27432743 (is (instance? PersistentArrayMap am)))))
27442744
2745+ (deftest test-cljs-1199
2746+ (testing " array-map should skip dropped elements of IndexedSeq"
2747+ (is (= {:a 1 } (apply array-map (drop 1 [0 :a 1 ]))))))
2748+
27452749(comment
27462750 ; ; ObjMap
27472751 ; ; (let [ks (map (partial str "foo") (range 500))
You can’t perform that action at this time.
0 commit comments