File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 100
100
101
101
(defn analyze-form [form]
102
102
(with-bindings {clojure.lang.Compiler/LOADER (clojure.lang.RT/makeClassLoader )}
103
- (binding [ana/*deps* (or ana/*deps* (atom #{}))
104
- ana/*global-env* (ana/global-env )]
103
+ (binding [ana/*deps* (or ana/*deps* (atom #{}))]
105
104
(-> (analyze-form* (rewrite-defcached form))
106
105
(ana/resolve-syms-pass )))))
107
106
Original file line number Diff line number Diff line change 465
465
(:macro (meta maybe-macro)))
466
466
(do
467
467
(swap! *deps* conj maybe-macro)
468
- (analyze* env (macroexpand-hook maybe-macro form env (rest form))))
468
+ (let [expanded (macroexpand-hook maybe-macro form env (rest form))]
469
+ (analyze* env expanded)))
469
470
{:op :invoke
470
471
:form form
471
472
:env env
Original file line number Diff line number Diff line change 11
11
[nextjournal.clerk.config :as config]
12
12
[nextjournal.clerk.fixtures.dep-a]
13
13
[nextjournal.clerk.fixtures.dep-b]
14
+ [nextjournal.clerk.fixtures.issue-660-repro]
14
15
[nextjournal.clerk.parser :as parser]
15
16
[weavejester.dependency :as dep])
16
17
(:import (clojure.lang ExceptionInfo)))
182
183
(dissoc (ana/analyze '(nextjournal.clerk/defcached answer (do (Thread/sleep 4200 ) (inc 41 )))) :form )))))
183
184
184
185
(testing " tools.analyzer AssertionError is rethrown as ExceptionInfo (#307)"
185
- (is (thrown? ExceptionInfo (ana/analyze '(def foo [] :bar ))))))
186
+ (is (thrown? ExceptionInfo (ana/analyze '(def foo [] :bar )))))
187
+
188
+ (testing " macro-expansion defining var occurs in deps"
189
+ (with-ns-binding 'nextjournal.clerk.fixtures.issue-660-repro
190
+ (= 2 (count (:deps (ana/analyze '(nextjournal.clerk.fixtures.macros/emit-nonsense))))))))
186
191
187
192
(deftest symbol->jar
188
193
(is (ana/symbol->jar 'io.methvin.watcher.PathUtils))
@@ -403,7 +408,6 @@ my-uuid")]
403
408
(-> specter-repro-analysis
404
409
(assoc :record-missing-hash-fn (fn [report-entry] (swap! !missing-hash-store conj report-entry)))
405
410
ana/hash)
406
-
407
411
(def missing-hash-report (first (deref !missing-hash-store)))
408
412
409
413
(is (= 'nextjournal.clerk.fixtures.issue-660-repro/nonsense
You can’t perform that action at this time.
0 commit comments