File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 1394
1394
:children (vec (concat [v] tests thens (if default [default ])))}))
1395
1395
1396
1396
(defmethod parse 'throw
1397
- [op env [_ throw :as form] name _]
1398
- (let [throw-expr (disallowing-recur (analyze (assoc env :context :expr ) throw ))]
1397
+ [op env [_ throw-form :as form] name _]
1398
+ (cond
1399
+ (= 1 (count form))
1400
+ (throw
1401
+ (error env " Too few arguments to throw, throw expects a single Error instance" ))
1402
+ (< 2 (count form))
1403
+ (throw
1404
+ (error env " Too many arguments to throw, throw expects a single Error instance" )))
1405
+ (let [throw-expr (disallowing-recur (analyze (assoc env :context :expr ) throw-form ))]
1399
1406
{:env env :op :throw :form form
1400
1407
:throw throw-expr
1401
1408
:children [throw-expr ]}))
You can’t perform that action at this time.
0 commit comments