File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change 1234
1234
1235
1235
; ;;; Vars
1236
1236
1237
- (defn analyze-var [ctx [_ var-name]]
1238
- (second
1239
- (resolve/lookup (assoc ctx :bindings {}) var-name false nil true )))
1240
-
1241
- #_(sci.core/eval-string " (def x 2) (let [x 1 x #'x] x)" )
1237
+ (defn analyze-var [ctx [_ var-name :as expr]]
1238
+ (or (second
1239
+ (resolve/lookup (assoc ctx :bindings {}) var-name false nil true ))
1240
+ (throw-error-with-location (str " Unable to resolve var: " var-name) expr)))
1242
1241
1243
1242
(defn analyze-set! [ctx [_ obj v :as expr]]
1244
1243
(cond
Original file line number Diff line number Diff line change 342
342
:cljs (is (nil? (sci/eval-string " (resolve 'js/Error)" {:classes {'js #js {:Error js/Error}}}))))
343
343
(is (= 1 (eval* " ((binding [*ns* 'user] (resolve 'inc)) 0)" )))
344
344
(is (= 2 (eval* " (def x 2) (let [x 1 x #'x] @x)" )))
345
- ; ; TODO: crash: user=> (sci/eval-string "#'ffoooo")
346
- nil
347
- )
345
+ (is (thrown-with-msg? Exception #"dude" (eval* " (defn foo [] #'dude)" )))
346
+ (is (thrown-with-msg? Exception #"inc" (sci/eval-string " (defn foo [] #'inc)" {:deny '[inc]}))))
348
347
349
348
#?(:clj
350
349
(deftest type-hint-let-test
You can’t perform that action at this time.
0 commit comments