File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change 691691 [module]
692692 ; ; we need to check both keys and values of the JS module index, because
693693 ; ; macroexpansion will be looking for the provided name - António Monteiro
694- (-> (into #{} (mapcat identity) (get-in @env/*compiler* [:js-module-index ]))
695- (contains? module)))
694+ (contains?
695+ (into #{} (mapcat identity) (get-in @env/*compiler* [:js-module-index ]))
696+ (str module)))
696697
697698(defn confirm-var-exists
698699 ([env prefix suffix]
711712 (not (loaded-js-ns? env prefix))
712713 (not (and (= 'cljs.core prefix) (= 'unquote suffix)))
713714 (nil? (gets @env/*compiler* ::namespaces prefix :defs suffix))
714- (not (js-module-exists? ( str prefix) )))
715+ (not (js-module-exists? prefix)))
715716 (missing-fn env prefix suffix)))))
716717
717718(defn confirm-var-exists-throw []
746747 ; ; macros may refer to namespaces never explicitly required
747748 ; ; confirm that the library at least exists
748749 #?(:clj (nil? (util/ns->source ns-sym)))
749- (not (js-module-exists? ( str ns-sym) )))
750+ (not (js-module-exists? ns-sym)))
750751 (warning :undeclared-ns env {:ns-sym ns-sym})))
751752
752753(defn core-name?
921922 (some? (gets @env/*compiler* ::namespaces (-> env :ns :name ) :imports sym))
922923 (recur env (gets @env/*compiler* ::namespaces (-> env :ns :name ) :imports sym) confirm)
923924
925+ (or (js-module-exists? s)
926+ (js-module-exists? (resolve-ns-alias env s)))
927+ (let [module (or (gets @env/*compiler* :js-module-index s)
928+ (resolve-ns-alias env s))]
929+ {:name (symbol module)
930+ :ns 'js})
931+
924932 :else
925933 (let [cur-ns (-> env :ns :name )
926934 full-ns (cond
You can’t perform that action at this time.
0 commit comments