Skip to content

Commit 6b7e940

Browse files
committed
CLJS-2736: Elements returned from sets as functions are not the actual elements in the set
1 parent 9100030 commit 6b7e940

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/main/cljs/cljs/core.cljs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9102,8 +9102,8 @@ reduces them without incurring seq initialization"
91029102
(-lookup [coll v]
91039103
(-lookup coll v nil))
91049104
(-lookup [coll v not-found]
9105-
(if (-contains-key? hash-map v)
9106-
v
9105+
(if-let [entry (-find hash-map v)]
9106+
(key entry)
91079107
not-found))
91089108

91099109
ISet

src/test/cljs/cljs/collections_test.cljs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
(ns cljs.collections-test
1010
(:refer-clojure :exclude [iter])
11-
(:require [cljs.test :refer-macros [deftest testing is are]]
11+
(:require [cljs.test :refer-macros [deftest testing is are run-tests]]
1212
[clojure.string :as s]
1313
[clojure.set :as set]))
1414

@@ -998,3 +998,13 @@
998998
(is (not (realized? xs)))
999999
(is (not (realized? ys)))
10001000
(is (= () xs ys))))
1001+
1002+
(deftest test-cljs-2736
1003+
(let [s #{(with-meta [:a] {:n 42})}]
1004+
(is (= {:n 42} (meta (s [:a]))))))
1005+
1006+
(comment
1007+
1008+
(run-tests)
1009+
1010+
)

0 commit comments

Comments
 (0)