Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/main/clojure/cljs/analyzer.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -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 "." "$")
Expand Down
6 changes: 6 additions & 0 deletions src/test/clojure/cljs/analyzer_tests.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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))))