Skip to content

Commit 95a406a

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents de6ec36 + 90c0b78 commit 95a406a

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/main/cljs/cljs/core.cljs

+5-3
Original file line numberDiff line numberDiff line change
@@ -6149,9 +6149,11 @@ reduces them without incurring seq initialization"
61496149
ILookup
61506150
(-lookup [coll k] (-lookup coll k nil))
61516151

6152-
(-lookup [coll k not-found] (if (number? k)
6153-
(-nth coll k not-found)
6154-
not-found))
6152+
(-lookup [coll k not-found]
6153+
(cond
6154+
(not ^boolean (.-edit root)) (throw (js/Error. "lookup after persistent!"))
6155+
(number? k) (-nth coll k not-found)
6156+
:else not-found))
61556157

61566158
IFn
61576159
(-invoke [coll k]

src/test/cljs/cljs/collections_test.cljs

+5
Original file line numberDiff line numberDiff line change
@@ -1024,6 +1024,11 @@
10241024
(chunk-append b 0)
10251025
(next (chunk-cons (chunk b) nil))))))
10261026

1027+
(deftest test-cljs-3124
1028+
(let [t (assoc! (transient []) 0 1)]
1029+
(persistent! t)
1030+
(is (= :fail (try (get t :a :not-found) (catch js/Error e :fail))))))
1031+
10271032
(comment
10281033

10291034
(run-tests)

0 commit comments

Comments
 (0)