-
-
Save mhuebert/286b09f672e834fbb21d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 61bdf6adcf3b04e627616082be926eade9fe8202 Mon Sep 17 00:00:00 2001 | |
From: Matthew Huebert <no-email@gmail.com> | |
Date: Wed, 17 Feb 2016 21:47:24 +0100 | |
Subject: [PATCH] CLJS-1576: cljs.js sourcemap support throws on non-latin1 | |
characters | |
Escape non-Latin1 characters before base64 encoding the source-map string. | |
--- | |
src/main/cljs/cljs/js.cljs | 2 +- | |
1 file changed, 1 insertion(+), 1 deletion(-) | |
diff --git a/src/main/cljs/cljs/js.cljs b/src/main/cljs/cljs/js.cljs | |
index 8a1e42c..a68f0c9 100644 | |
--- a/src/main/cljs/cljs/js.cljs | |
+++ b/src/main/cljs/cljs/js.cljs | |
@@ -149,7 +149,7 @@ | |
(.append sb | |
(str "\n//# sourceURL=" file | |
"\n//# sourceMappingURL=data:application/json;base64," | |
- (base64/encodeString json))))) | |
+ (base64/encodeString (string/replace json #"%([0-9A-F]{2})" (.fromCharCode js/String "0x$1"))))))) | |
;; ----------------------------------------------------------------------------- | |
;; Analyze | |
-- | |
2.2.1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment