Permalink
Browse files

MATCH-82: locals matching in ClojureScript broken

&env is not the bindings as it in Clojure, rather we need to inspect
the :locals property. Fixed bad test.
  • Loading branch information...
1 parent cd32056 commit e270f057b0d9c0d0ce5c7aa4603b8b03e7c68093 @swannodette swannodette committed Jul 25, 2013
Showing with 6 additions and 6 deletions.
  1. +4 −4 src/main/clojure/cljs/core/match/macros.clj
  2. +2 −2 src/test/cljs/core/match/tests.cljs
@@ -19,7 +19,7 @@
(partition 2 clauses))])]
(binding [*clojurescript* true
*line* (-> &form meta :line)
- *locals* (dissoc &env '_)
+ *locals* (dissoc (:locals &env) '_)
*warned* (atom false)]
`~(clj-form vars clauses))))
@@ -34,7 +34,7 @@
(partition 2 clauses))])]
(binding [*clojurescript* true
*line* (-> &form meta :line)
- *locals* (dissoc &env '_)
+ *locals* (dissoc (:locals &env) '_)
*warned* (atom false)
*no-backtrack* true]
`~(clj-form vars clauses))))
@@ -43,15 +43,15 @@
(binding [*clojurescript* true
*vector-type* type
*line* (-> &form meta :line)
- *locals* (dissoc &env '_)
+ *locals* (dissoc (:locals &env) '_)
*warned* (atom false)]
`~(clj-form vars clauses)))
(defmacro matchv* [type vars & clauses]
(binding [*clojurescript* true
*vector-type* type
*line* (-> &form meta :line)
- *locals* (dissoc &env '_)
+ *locals* (dissoc (:locals &env) '_)
*warned* (atom false)
*no-backtrack* true]
`~(clj-form vars clauses)))
@@ -398,7 +398,7 @@
(assert
(= (let [x 2
- y 2]
+ y 2]
(match [x]
[0] :a0
[1] :a1
@@ -915,7 +915,7 @@
(match 2
x 1
_ 2))
- 1))
+ 2))
;; MATCH-83

0 comments on commit e270f05

Please sign in to comment.