From d162c2b49f557c1a18514c77702c7ae27fe8de11 Mon Sep 17 00:00:00 2001 From: Nathan Marz Date: Sun, 29 May 2016 09:06:51 -0400 Subject: [PATCH] advise cljs compiler not to warn about undeclared var instead of the hack that was being used before --- src/clj/com/rpl/specter/impl.cljx | 1 + src/clj/com/rpl/specter/macros.clj | 11 +++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/clj/com/rpl/specter/impl.cljx b/src/clj/com/rpl/specter/impl.cljx index 1aaa806..6a4afe9 100644 --- a/src/clj/com/rpl/specter/impl.cljx +++ b/src/clj/com/rpl/specter/impl.cljx @@ -12,6 +12,7 @@ [clojure.string :as s] #+clj [com.rpl.specter.defhelpers :as dh] #+clj [riddley.walk :as riddley] +;; #+cljs [cljs.js :as cljs] ) #+clj (:import [com.rpl.specter Util]) diff --git a/src/clj/com/rpl/specter/macros.clj b/src/clj/com/rpl/specter/macros.clj index d09ef8d..9b7a077 100644 --- a/src/clj/com/rpl/specter/macros.clj +++ b/src/clj/com/rpl/specter/macros.clj @@ -445,15 +445,16 @@ ;; to invoke and/or parameterize the precompiled path without ;; a bunch of checks beforehand cache-id (if (= platform :clj) (i/gen-uuid-str)) - cache-sym (gensym "pathcache") ;; used for cljs + cache-sym (if (= platform :cljs) + (vary-meta + (gensym "pathcache") + assoc :cljs.analyzer/no-resolve true)) - ;; this is used to avoid warnings in cljs code about undeclared var - cache-qualified-sym (symbol (str *ns* "." cache-sym)) info-sym (gensym "info") get-cache-code (if (= platform :clj) `(i/get-path-cache ~cache-id) - cache-qualified-sym + cache-sym ) add-cache-code (if (= platform :clj) `(i/add-path-cache! ~cache-id ~info-sym) @@ -480,8 +481,6 @@ ~prepared-path ~(str *ns*) (quote ~used-locals) - ;;possible-params is wrong atm - ;;as is used-locals in cljs... (quote ~possible-params) )] ~add-cache-code