Skip to content

Commit fcd1358

Browse files
committed
add goog.object to set of implicit namespaces
break out implicit namespaces set and reuse
1 parent 54ac930 commit fcd1358

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/clojure/cljs/analyzer.cljc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,10 +556,12 @@
556556
(throw err#)
557557
(throw (error ~env (.getMessage err#) err#)))))))
558558

559+
(def implicit-nses '#{cljs.core goog goog.object goog.string goog.array Math})
560+
559561
(defn implicit-import?
560562
#?(:cljs {:tag boolean})
561563
[env prefix suffix]
562-
(contains? '#{goog goog.object goog.string goog.array Math} prefix))
564+
(contains? implicit-nses prefix))
563565

564566
(defn confirm-var-exist-warning [env prefix suffix]
565567
(fn [env prefix suffix]
@@ -615,7 +617,7 @@
615617
"Given env, an analysis environment, and ns-sym, a symbol identifying a
616618
namespace, confirm that the namespace exists. Warn if not found."
617619
[env ns-sym]
618-
(when (and (nil? (get '#{cljs.core goog Math goog.string} ns-sym))
620+
(when (and (nil? (get implicit-nses ns-sym))
619621
(nil? (get (-> env :ns :requires) ns-sym))
620622
;; something else may have loaded the namespace, i.e. load-file
621623
(nil? (gets @env/*compiler* ::namespaces ns-sym))

0 commit comments

Comments
 (0)