Skip to content

Commit ec1e416

Browse files
committed
CLJS-2770: Problem with namespaces starting with com in Rhino
1 parent 343e6ae commit ec1e416

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/main/clojure/cljs/analyzer.cljc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,9 @@
181181
"synchronized" "this" "throw" "throws"
182182
"transient" "try" "typeof" "var" "void"
183183
"volatile" "while" "with" "yield" "methods"
184-
"null" "constructor"})
184+
"null" "constructor"
185+
"com" ;; for Rhino
186+
})
185187

186188
(def es5-allowed
187189
#{"default"})
@@ -2600,8 +2602,10 @@
26002602
(let [segments (string/split (clojure.core/name name) #"\.")]
26012603
(when (= 1 (count segments))
26022604
(warning :single-segment-namespace env {:name name}))
2603-
(when (some? (some js-reserved segments))
2604-
(warning :munged-namespace env {:name name}))
2605+
(let [segment (some js-reserved segments)]
2606+
;; don't complain about "com", for Rhino
2607+
(when (and (some? segment) (not= "com" segment))
2608+
(warning :munged-namespace env {:name name})))
26052609
(find-def-clash env name segments)
26062610
#?(:clj
26072611
(when (some (complement util/valid-js-id-start?) segments)
@@ -2613,7 +2617,6 @@
26132617
mdocstr (-> name meta :doc)
26142618
args (if (some? docstring) (next args) args)
26152619
metadata (when (map? (first args)) (first args))
2616-
form-meta (meta form)
26172620
args (desugar-ns-specs
26182621
#?(:clj (rewrite-cljs-aliases
26192622
(if metadata (next args) args))

0 commit comments

Comments
 (0)