Skip to content

Commit 9778b34

Browse files
Matthew Huebertswannodette
Matthew Huebert
authored andcommitted
CLJS-1576: fix source-map string encoding by applying encodeURIComponent and fixing string/replace call
1 parent 300e326 commit 9778b34

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/cljs/cljs/js.cljs

+4-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,10 @@
175175
(.append sb
176176
(str "\n//# sourceURL=" file
177177
"\n//# sourceMappingURL=data:application/json;base64,"
178-
(base64/encodeString (string/replace json #"%([0-9A-F]{2})" (.fromCharCode js/String "0x$1")))))))
178+
(-> (js/encodeURIComponent json)
179+
(string/replace #"%([0-9A-F]{2})" (fn [[_ match]]
180+
(.fromCharCode js/String (str "0x" match))))
181+
(base64/encodeString))))))
179182

180183
(defn- current-alias-map
181184
[]

0 commit comments

Comments
 (0)