                     s
                     (slurp (io/reader (-url this))))))
 
-(defrecord JavaScriptFile [foreign ^URL url provides requires lines source-map]
+(defrecord JavaScriptFile [foreign ^URL url ^URL source-url provides requires lines source-map]
   IJavaScript
   (-foreign? [this] foreign)
   (-url [this] url)

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

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

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

  (-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
