Permalink
Browse files

CLJS-638: Keyword invoke is inconsistent with clojure

Keyword -lookup arity incorrectly dispatched to the 3 argument get instead
of 2 argument get.
  • Loading branch information...
1 parent d643d73 commit fbae5fb331e9e45c89f95b94b372947e43ad254d @swannodette swannodette committed Oct 25, 2013
Showing with 10 additions and 1 deletion.
  1. +1 −1 src/cljs/cljs/core.cljs
  2. +9 −0 test/cljs/cljs/core_test.cljs
@@ -2020,7 +2020,7 @@ reduces them without incurring seq initialization"
false))
IFn
(-invoke [kw coll]
- (get coll kw nil))
+ (get coll kw))
(-invoke [kw coll not-found]
(get coll kw not-found))
@@ -1971,5 +1971,14 @@
;; CLJS-608
(assert (= '("") (re-seq #"\s*" "")))
+ ;; CLJS-638
+
+ (deftype KeywordTest []
+ ILookup
+ (-lookup [o k] :nothing)
+ (-lookup [o k not-found] not-found))
+
+ (assert (= (:a (KeywordTest.)) :nothing))
+
:ok
)

0 comments on commit fbae5fb

Please sign in to comment.