File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 767
767
false ))
768
768
(not (contains? (-> env :ns :excludes ) sym))))
769
769
770
+ (defn public-name?
771
+ " Is sym public?"
772
+ #? (:cljs {:tag boolean})
773
+ [ns sym]
774
+ (let [var-ast (or (gets @env/*compiler* ::namespaces ns :defs sym)
775
+ #?(:clj (gets @env/*compiler* ::namespaces ns :macros sym)
776
+ :cljs (gets @env/*compiler* ::namespaces (symbol (str (name ns ) " $macros" )) :defs sym)))]
777
+ (and (some? var-ast)
778
+ (not (or (:private var-ast)
779
+ (:anonymous var-ast))))))
780
+
770
781
(defn js-tag? [x]
771
782
(and (symbol? x)
772
783
(or (= 'js x)
1354
1365
(let [env (if (or (and (not= ns-name 'cljs.core)
1355
1366
(core-name? env sym))
1356
1367
(some? (get-in @env/*compiler* [::namespaces ns-name :uses sym])))
1357
- (let [ev (resolve-existing-var (dissoc env :locals ) sym)
1368
+ (let [ev (resolve-existing-var (dissoc env :locals ) ( with-meta sym { ::no-resolve true }) )
1358
1369
conj-to-set (fnil conj #{})]
1359
- (warning :redef env {:sym sym :ns (:ns ev) :ns-name ns-name})
1370
+ (when (public-name? (:ns ev) sym)
1371
+ (warning :redef env {:sym sym :ns (:ns ev) :ns-name ns-name}))
1360
1372
(swap! env/*compiler* update-in [::namespaces ns-name :excludes ]
1361
1373
conj-to-set sym)
1362
1374
(update-in env [:ns :excludes ] conj-to-set sym))
You can’t perform that action at this time.
0 commit comments