Skip to content

Commit 2448716

Browse files
mfikesdnolen
authored and
dnolen
committed
CLJS-2449: Can't bind catch
1 parent 9ec796d commit 2448716

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/main/cljs/cljs/core.cljs

-1
Original file line numberDiff line numberDiff line change
@@ -10908,7 +10908,6 @@ reduces them without incurring seq initialization"
1090810908
(defn ^boolean special-symbol?
1090910909
"Returns true if x names a special form"
1091010910
[x]
10911-
;; If adding new special symbols, be sure to update cljs.analyzer/specials
1091210911
(contains?
1091310912
'#{if def fn* do let* loop* letfn* throw try catch finally
1091410913
recur new set! ns deftype* defrecord* . js* & quote case* var ns*}

src/main/clojure/cljs/analyzer.cljc

+3-2
Original file line numberDiff line numberDiff line change
@@ -1167,8 +1167,9 @@
11671167

11681168
(declare analyze analyze-symbol analyze-seq)
11691169

1170-
;; If adding new specials, be sure to update cljs.core/special-symbol?
1171-
(def specials '#{if def fn* do let* loop* letfn* throw try catch finally recur new set!
1170+
;; Note: This is the set of parse multimethod dispatch values,
1171+
;; along with '&, and differs from cljs.core/special-symbol?
1172+
(def specials '#{if def fn* do let* loop* letfn* throw try recur new set!
11721173
ns deftype* defrecord* . js* & quote case* var ns*})
11731174

11741175
(def ^:dynamic *recur-frames* nil)

src/test/cljs/cljs/core_test.cljs

+4
Original file line numberDiff line numberDiff line change
@@ -1483,6 +1483,10 @@
14831483
(is (= "##Inf" (pr-str js/Infinity)))
14841484
(is (= "##-Inf" (pr-str js/-Infinity))))
14851485

1486+
(deftest test-cljs-2449
1487+
(is (= 1 (let [catch identity] (catch 1))))
1488+
(is (= 1 (let [finally identity] (finally 1)))))
1489+
14861490
(deftype Foo2407 [x y])
14871491
(defrecord Bar2407 [x y])
14881492

0 commit comments

Comments
 (0)