From 1fc24fd50b22767dcbd5e20ef8d429e7d7e4fe75 Mon Sep 17 00:00:00 2001 From: "Kevin J. Lynagh" Date: Sat, 30 Jun 2012 09:28:59 -0700 Subject: [PATCH] Use Clojure's set and keys fns when in ClojureScript, rather than Java-specific #keySet method. --- src/main/clojure/clojure/core/match.clj | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/clojure/clojure/core/match.clj b/src/main/clojure/clojure/core/match.clj index 4fc0954..d5c8cc7 100644 --- a/src/main/clojure/clojure/core/match.clj +++ b/src/main/clojure/clojure/core/match.clj @@ -1051,7 +1051,9 @@ (if only (let [a (with-meta (gensym) {:tag 'java.util.Map})] (cons (guard-pattern (wildcard-pattern) - (set [`(fn [~a] (= (.keySet ~a) #{~@only}))])) + (set [(if *clojurescript* + `(fn [~a] (= (set (keys ~a)) #{~@only})) + `(fn [~a] (= (.keySet ~a) #{~@only})))])) ps)) (cons (wildcard-pattern) ps)) ps)] -- 1.7.10