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"
7448
7448
" keyval => key val
7449
7449
Returns a new array map with supplied mappings."
7450
7450
[& keyvals]
7451
- (let [arr (if (instance? IndexedSeq keyvals)
7451
+ (let [arr (if (and ( instance? IndexedSeq keyvals) ( zero? ( .-i keyvals)) )
7452
7452
(.-arr keyvals)
7453
7453
(into-array keyvals))]
7454
7454
(.fromArray cljs.core/PersistentArrayMap arr true false )))
Original file line number Diff line number Diff line change 2686
2686
(defn foo-set [x]
2687
2687
(first x))
2688
2688
2689
- (deftest test-cljs-982-var-deref []
2689
+ (deftest test-cljs-982-var-deref
2690
2690
(let [f (foo-var #'foo-set)]
2691
2691
(is (= (f [1 2 3 ]) 1 ))
2692
2692
(set! foo-set (fn [x] :oops ))
2731
2731
:foo #'foo-1187
2732
2732
:bar #'bar-1187) []))
2733
2733
2734
- (deftest test-cljs-1187 []
2734
+ (deftest test-cljs-1187
2735
2735
(testing " Internal var nodes analyzed in expression context"
2736
2736
(is (= (with-out-str (print-foo-1187 :foo ))
2737
2737
" foo!" ))))
2738
2738
2739
- (deftest test-cljs-1189 []
2739
+ (deftest test-cljs-1189
2740
2740
(testing " array-map should always return array maps"
2741
2741
(let [am (apply array-map (range 100 ))]
2742
2742
(is (== (count am) 50 ))
2743
2743
(is (instance? PersistentArrayMap am)))))
2744
2744
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
+
2745
2749
(comment
2746
2750
; ; ObjMap
2747
2751
; ; (let [ks (map (partial str "foo") (range 500))
You can’t perform that action at this time.
0 commit comments