<< Back to previous view

[CLJS-557] CLONE - Inconsistent munging of namespaces with dashes Created: 27/Jul/13  Updated: 27/Jul/13  Resolved: 27/Jul/13

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: Anonymous Assignee: Brenton Ashworth
Resolution: Completed Votes: 0
Labels: None

Approval: Screened


When creating a file with a namespace like `foo.bar-baz` the compiled file will have a dash in the `goog.provide` but then use underscores within the code.

foo.bar_baz.something = ....

When requiring this namespace in another file the `goog.require` and the code both use dashes.

var x = foo.bar-baz.something();

Assuming that file names must use underscores instead of dashes, as in Clojure on the JVM, there is a related issue in the `cljs.closure` namespace where it incorrectly creates file names from namespaces with dashes. The first line in the let form of the `get-compiled-cljs` function is the problem and can be replaced with a call to something like:

(defn ns->file-name [s]
(let [ns (name s)
path (string/replace (munge ns) \. java.io.File/separatorChar)]
(str path ".cljs")))

Imported from github issue #86

Comment by David Nolen [ 27/Jul/13 1:47 PM ]

clone was resolved

Generated at Sat Oct 21 03:46:50 CDT 2017 using JIRA 4.4#649-r158309.