Skip to content

Commit 746bbb1

Browse files
author
dnolen
committed
CLJS-1082: analysis memoization bug
drop :cljs.analyzer/analyzed-cljs, redundant, use :cljs.analyzer/namespaces as source of truth of analyzed namespaces
1 parent b7e3935 commit 746bbb1

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/clj/cljs/analyzer.clj

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1979,7 +1979,7 @@ argument, which the reader will use in any emitted errors."
19791979
cache (when (or (= (:ns ns-info) 'cljs.core)
19801980
(and (:cache-analysis opts) output-dir))
19811981
(cache-file res ns-info output-dir))]
1982-
(when-not (get-in @env/*compiler* [::analyzed-cljs path])
1982+
(when-not (get-in @env/*compiler* [::namespaces (:ns ns-info)])
19831983
(if (or (not= (:ns ns-info) 'cljs.core)
19841984
(not cache)
19851985
(requires-analysis? res output-dir))
@@ -1999,8 +1999,7 @@ argument, which the reader will use in any emitted errors."
19991999
(recur ns (next forms))))
20002000
ns))]
20012001
(when (and cache (true? (:cache-analysis opts)))
2002-
(write-analysis-cache ns cache))
2003-
(swap! env/*compiler* assoc-in [::analyzed-cljs path] true)))
2002+
(write-analysis-cache ns cache))))
20042003
;; we want want to keep dependency analysis information
20052004
;; don't revert the environment - David
20062005
(let [{:keys [ns]}
@@ -2017,5 +2016,4 @@ argument, which the reader will use in any emitted errors."
20172016
(doseq [x (get-in cached-ns [::constants :order])]
20182017
(register-constant! x))
20192018
(-> cenv
2020-
(assoc-in [::analyzed-cljs path] true)
20212019
(assoc-in [::namespaces ns] cached-ns))))))))))))))

src/clj/cljs/compiler.clj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,8 +1015,7 @@
10151015
:source-map-timestamp (:source-map-timestamp opts)
10161016
:source-map-pretty-print (:source-map-pretty-print opts)}))))
10171017
(let [path (.getPath (.toURL ^File dest))]
1018-
(swap! env/*compiler* assoc-in [::compiled-cljs path] ret)
1019-
(swap! env/*compiler* assoc-in [::ana/analyzed-cljs path] true))
1018+
(swap! env/*compiler* assoc-in [::compiled-cljs path] ret))
10201019
(let [{:keys [output-dir cache-analysis]} opts]
10211020
(when (and (true? cache-analysis) output-dir)
10221021
(ana/write-analysis-cache ns-name

0 commit comments

Comments
 (0)