From cee4668e475183c0ffabab361903bf4c9a42c0dd Mon Sep 17 00:00:00 2001 From: develar Date: Fri, 20 Sep 2013 17:10:53 +0400 Subject: [PATCH] JS backend: don't add file:// prefix to sourcemap url. Use name of generated source map file instead of absolute path. (cherry picked from commit 126e977 and ec2fc20) --- .../jetbrains/js/compiler/sourcemap/SourceMap3Builder.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/js.translator/src/org/jetbrains/js/compiler/sourcemap/SourceMap3Builder.java b/js/js.translator/src/org/jetbrains/js/compiler/sourcemap/SourceMap3Builder.java index d336a872594..11f0d9ae0ca 100644 --- a/js/js.translator/src/org/jetbrains/js/compiler/sourcemap/SourceMap3Builder.java +++ b/js/js.translator/src/org/jetbrains/js/compiler/sourcemap/SourceMap3Builder.java @@ -131,8 +131,9 @@ public class SourceMap3Builder implements SourceMapBuilder { @Override public void addLink() { - textOutput.print("\n//@ sourceMappingURL=file://"); - textOutput.print(getOutFile().getAbsolutePath()); + textOutput.print("\n//@ sourceMappingURL="); + textOutput.print(generatedFile.getName()); + textOutput.print(".map"); } private static final class Base64VLQ { @@ -146,6 +147,7 @@ public class SourceMap3Builder implements SourceMapBuilder { // The continuation bit is the 6th bit. private static final int VLQ_CONTINUATION_BIT = VLQ_BASE; + @SuppressWarnings("SpellCheckingInspection") private static final char[] BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".toCharArray(); private Base64VLQ() {