Skip to content

Commit 8b409e0

Browse files
anmonteiroswannodette
authored andcommitted
CLJS-2028: realized? throws on LazyTransformer
1 parent cf617c8 commit 8b409e0

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/main/cljs/cljs/core.cljs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4015,7 +4015,11 @@ reduces them without incurring seq initialization"
40154015
(-seq this))
40164016
(if (nil? rest)
40174017
nil
4018-
(-seq rest))))
4018+
(-seq rest)))
4019+
4020+
IPending
4021+
(-realized? [_]
4022+
(nil? stepper)))
40194023

40204024
(es6-iterable LazyTransformer)
40214025

src/test/cljs/cljs/core_test.cljs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@
846846
(testing "Testing CLJS-853, function metadata"
847847
(is (= {:foo true} (meta ^:foo (fn []))))))
848848

849-
(deftest test-807
849+
(deftest test-807
850850
(testing "Testing CLJS-807, big int, float, big dec literals"
851851
(is (= -1 -1N))
852852
(is (= 9.007199254740996E15 9007199254740995N))
@@ -1189,6 +1189,12 @@
11891189
(is (= (get "0123" nil :not-found) :not-found))
11901190
(is (= (get #js [0 1 2 3] nil :not-found) :not-found)))
11911191

1192+
(deftest test-cljs-2028
1193+
(let [x (sequence (filter pos?) [1 2 -1])]
1194+
(is (not (realized? x)))
1195+
(is (= x [1 2]))
1196+
(is (realized? x))))
1197+
11921198
(comment
11931199
;; ObjMap
11941200
;; (let [ks (map (partial str "foo") (range 500))

0 commit comments

Comments
 (0)