Skip to content

Commit 0ad7f04

Browse files
committed
* missing information from try/catch processing, we need to add :local :catch so that analyze-symbol can pick it up later
* add test-try
1 parent 1ce0ca7 commit 0ad7f04

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Diff for: src/main/clojure/cljs/analyzer.cljc

+5-1
Original file line numberDiff line numberDiff line change
@@ -1880,7 +1880,11 @@
18801880
(assoc locals e
18811881
{:name e
18821882
:line (get-line e env)
1883-
:column (get-col e env)})
1883+
:column (get-col e env)
1884+
;; :local is required for {:op :local ...} nodes
1885+
;; but previously we had no way to figure this out
1886+
;; by adding it here we can recover it later
1887+
:local :catch})
18841888
locals)
18851889
catch (when cblock
18861890
(disallowing-recur (analyze (assoc catchenv :locals locals) cblock)))

Diff for: src/test/clojure/cljs/analyzer/spec_tests.clj

+1-1
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@
249249
(is (= :throw (:op node)))
250250
(is (s/valid? ::a/node node))))
251251

252-
#_(deftest test-try
252+
(deftest test-try
253253
(let [node (no-warn (analyze ns-env '(try 1 (catch :default e) (finally))))]
254254
(is (= :try (:op node)))
255255
(is (s/valid? ::a/node node))))

0 commit comments

Comments
 (0)