diff --git a/src/main/clojure/cljs/analyzer.cljc b/src/main/clojure/cljs/analyzer.cljc index 574bfe6cc..65f68af46 100644 --- a/src/main/clojure/cljs/analyzer.cljc +++ b/src/main/clojure/cljs/analyzer.cljc @@ -513,14 +513,16 @@ (symbol? value) "cst$sym$" :else (throw - #?(:clj (Exception. (str "constant type " (type value) " not supported")) - :cljs (js/Error. (str "constant type " (type value) " not supported"))))) + #?(:clj (Exception. (str "constant type " (type value) " not supported")) + :cljs (js/Error. (str "constant type " (type value) " not supported"))))) name (if (keyword? value) (subs (str value) 1) (str value)) name (if (= "." name) "_DOT_" (-> name + (string/replace "_" "__") + (string/replace "$" "$$") (string/replace "-" "_DASH_") (munge) (string/replace "." "$") diff --git a/src/test/clojure/cljs/analyzer_tests.clj b/src/test/clojure/cljs/analyzer_tests.clj index 9b823bdac..8ae750ddc 100644 --- a/src/test/clojure/cljs/analyzer_tests.clj +++ b/src/test/clojure/cljs/analyzer_tests.clj @@ -1512,3 +1512,9 @@ (Foo. nil nil))))) (is (= 1 (count @ws))) (is (string/starts-with? (first @ws) "Wrong number of args (2) passed to Foo")))) + +(deftest test-cljs-3401 + (is (not= (ana/gen-constant-id '_PLUS_) + (ana/gen-constant-id '+))) + (is (not= (ana/gen-constant-id 'foo.bar) + (ana/gen-constant-id 'foo$bar))))