Skip to content

Commit 9441795

Browse files
committed
related to CLJS-1158, cljs.analyzer/analyze-file and
`cljs.compiler/compile-file` also needs to check `:defs`
1 parent 0d0f509 commit 9441795

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/clj/cljs/analyzer.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2145,7 +2145,7 @@
21452145
(.getPath ^URL res))
21462146
cache (when (:cache-analysis opts)
21472147
(cache-file res ns-info output-dir))]
2148-
(when-not (get-in @env/*compiler* [::namespaces (:ns ns-info)])
2148+
(when-not (get-in @env/*compiler* [::namespaces (:ns ns-info) :defs])
21492149
(if (or (not cache)
21502150
(requires-analysis? res output-dir))
21512151
(binding [*cljs-ns* 'cljs.user

src/clj/cljs/compiler.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@
11031103
(if (requires-compilation? src-file dest-file opts)
11041104
(do
11051105
(util/mkdirs dest-file)
1106-
(when (and (contains? (::ana/namespaces @env/*compiler*) ns)
1106+
(when (and (get-in @env/*compiler* [::ana/namespaces ns :defs])
11071107
(not= ns 'cljs.core))
11081108
(swap! env/*compiler* update-in [::ana/namespaces] dissoc ns))
11091109
(let [ret (compile-file* src-file dest-file opts)]
@@ -1117,7 +1117,7 @@
11171117
;; populate compilation environment with analysis information
11181118
;; when constants are optimized
11191119
(when (and (true? (:optimize-constants opts))
1120-
(not (contains? (::ana/namespaces @env/*compiler*) ns)))
1120+
(nil? (get-in @env/*compiler* [::ana/namespaces ns :defs])))
11211121
(with-core-cljs opts (fn [] (ana/analyze-file src-file opts))))
11221122
ns-info)))
11231123
(catch Exception e

0 commit comments

Comments
 (0)