Skip to content

Commit 6292633

Browse files
anmonteiroswannodette
authored andcommitted
CLJS-2256: Generated code doesn't add newline after sourceMappingURL comment
1 parent 7139c4c commit 6292633

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/main/clojure/cljs/closure.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,9 +1864,9 @@
18641864

18651865
(defn add-source-map-link [{:keys [source-map output-to] :as opts} js]
18661866
(if source-map
1867-
(if (= output-to :print)
1868-
(str js "\n//# sourceMappingURL=" source-map)
1869-
(str js "\n//# sourceMappingURL=" (path-relative-to (io/file output-to) {:url source-map})))
1867+
(if (= output-to :print)
1868+
(str js "\n//# sourceMappingURL=" source-map "\n\n")
1869+
(str js "\n//# sourceMappingURL=" (path-relative-to (io/file output-to) {:url source-map}) "\n\n"))
18701870
js))
18711871

18721872
(defn absolute-path? [path]

src/main/clojure/cljs/compiler.cljc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,7 +1279,7 @@
12791279
(defn emit-source-map [src dest sm-data opts]
12801280
(let [sm-file (io/file (str (.getPath ^File dest) ".map"))]
12811281
(if-let [smap (:source-map-asset-path opts)]
1282-
(emits "\n//# sourceMappingURL=" smap
1282+
(emitln "\n//# sourceMappingURL=" smap
12831283
(string/replace (util/path sm-file)
12841284
(str (util/path (io/file (:output-dir opts))))
12851285
"")
@@ -1288,7 +1288,7 @@
12881288
(if-not (string/index-of smap "?") "?" "&")
12891289
"rel=" (System/currentTimeMillis))
12901290
""))
1291-
(emits "\n//# sourceMappingURL="
1291+
(emitln "\n//# sourceMappingURL="
12921292
(or (:source-map-url opts) (.getName sm-file))
12931293
(if (true? (:source-map-timestamp opts))
12941294
(str "?rel=" (System/currentTimeMillis))

0 commit comments

Comments
 (0)