diff --git a/src/main/cljs/cljs/core.cljs b/src/main/cljs/cljs/core.cljs index 27a2f9e37..73bd921f2 100644 --- a/src/main/cljs/cljs/core.cljs +++ b/src/main/cljs/cljs/core.cljs @@ -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" diff --git a/src/test/cljs/cljs/seqs_test.cljs b/src/test/cljs/cljs/seqs_test.cljs index 3d7606da9..9e43a7340 100644 --- a/src/test/cljs/cljs/seqs_test.cljs +++ b/src/test/cljs/cljs/seqs_test.cljs @@ -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]) ()) @@ -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))))