   (-source [this] "The JavaScript source string."))
 
 (defprotocol ISourceMap
+  (-source-url [this] "Return the CLJS source url")
   (-source-map [this] "Return the CLJS compiler generated JS source mapping"))
 
 (extend-protocol IJavaScript

                    (+ line-offset (or (:lines source) 0))
                    (let [path (.getPath ^URL (:url source))]
                      (if-let [compiled (get @compiled-cljs path)] 
                        (assoc result path
                          (sm/merge-source-maps (:source-map compiled) closure-source-map line-offset))
                        result))))
                (spit (io/file (str name ".merged")) (sm/encode result {}))))))
        source)
      (report-failure result))))


  (-requires [this] requires)
  (-source [this] (slurp (io/reader url)))
  ISourceMap
  (-source-url [this] source-url)
  (-source-map [this] source-map))

(defn javascript-file
  ([foreign ^URL url provides requires]
     (javascript-file foreign url nil provides requires nil nil))
  ([foreign ^URL url source-url provides requires lines source-map]
     (JavaScriptFile. foreign url source-url (map name provides) (map name requires) lines source-map)))

(defn map->javascript-file [m]
  (javascript-file
    (:foreign m)
    (to-url (:file m))
    (to-url (:source-file m))
    (:provides m)
    (:requires m)
    (:lines m)
