                       sym))))
 
          :else
-         (let [full-ns (if (get (:defs (@namespaces 'cljs.core)) sym)
+         (let [full-ns (if (core-name? env sym)
                          'cljs.core
                          (-> env :ns :name))]
            (confirm-var-exists env full-ns sym)

  (let [sym (symbol name)]
    (get (:requires (:ns env)) sym sym)))

(defn resolve-existing-var [env sym]
  (let [s (str sym)
        lb (-> env :locals sym)


         :else
         (munge (symbol (str
                         (if (core-name? env sym)
                           'cljs.core
                           (-> env :ns :name))
                         "." (munge (name sym))))))]
