Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/main/cljs/cljs/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -2307,10 +2307,11 @@ reduces them without incurring seq initialization"
"Return true if the seq function is supported for s"
[s]
(or
(nil? s)
(satisfies? ISeqable s)
(array? s)
(string? s)))
(nil? s)
(satisfies? ISeqable s)
(js-iterable? s)
(array? s)
(string? s)))

(defn boolean
"Coerce to boolean"
Expand Down
8 changes: 7 additions & 1 deletion src/test/cljs/cljs/seqs_test.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@
(partition 5 [1 2 3]) ()

(partition 4 4 [0 0 0] (range 10)) '((0 1 2 3) (4 5 6 7) (8 9 0 0))

(partition -1 [1 2 3]) ()
(partition -2 [1 2 3]) ())

Expand Down Expand Up @@ -523,3 +523,9 @@
:initk initk)))]
(= (into [] (src))
(into [] (seq (src)))))))

(deftest cljs-3419-seq-js-iterable
(let [js-set (js/Set. #js [1 2 3 4])
js-map (js/Map. #js [#js [1 2] #js [3 4]])]
(is (seqable? js-set))
(is (seqable? js-map))))
Loading