Skip to content

Commit e531c34

Browse files
rabidpraxisdnolen
authored andcommitted
CLJS-1420 - get-in behavior differs from Clojure by always deferring to the 3 arity fn
Reverts back to original reduce for 2 arity get-in
1 parent 7f7b647 commit e531c34

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/main/cljs/cljs/core.cljs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4668,7 +4668,7 @@ reduces them without incurring seq initialization"
46684668
{:added "1.2"
46694669
:static true}
46704670
([m ks]
4671-
(get-in m ks nil))
4671+
(reduce get m ks))
46724672
([m ks not-found]
46734673
(loop [sentinel lookup-sentinel
46744674
m m

src/test/cljs/cljs/core_test.cljs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3111,6 +3111,15 @@
31113111
(deftest test-cljs-1569
31123112
(is (= (meta (with-meta (seq [1 2 3]) {:a 1})) {:a 1})))
31133113

3114+
(deftest test-cljs-1420
3115+
(is (= :2-arity
3116+
(get-in
3117+
(reify
3118+
ILookup
3119+
(-lookup [o k] :2-arity)
3120+
(-lookup [o k not-found] :3-arity))
3121+
[:foo]))))
3122+
31143123

31153124
(comment
31163125
;; ObjMap

0 commit comments

Comments
 (0)