JS: rewrite source map generator to use specialized JSON writer

Fixes problems with string escaping. See KT-20005
This commit is contained in:
Alexey Andreev
2017-09-05 16:23:22 +03:00
committed by Alexey Andreev
parent 187ca71dc6
commit 361d6dfca0
7 changed files with 48 additions and 39 deletions
+7
View File
@@ -0,0 +1,7 @@
$TESTDATA_DIR$/sourceMapCharEscape.kt
-no-stdlib
-source-map
-source-map-embed-sources
always
-output
$TEMP_DIR$/out.js
+1
View File
@@ -0,0 +1 @@
fun foo() = "©∑\n"
+1
View File
@@ -0,0 +1 @@
OK
+2
View File
@@ -0,0 +1,2 @@
// EXISTS: out.js
// CONTAINS: out.js.map, \"©∑\\n\"\n
@@ -545,6 +545,12 @@ public class CliTestGenerated extends AbstractCliTest {
doJsTest(fileName);
}
@TestMetadata("sourceMapCharEscape.args")
public void testSourceMapCharEscape() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/cli/js/sourceMapCharEscape.args");
doJsTest(fileName);
}
@TestMetadata("sourceMapDuplicateRelativePaths.args")
public void testSourceMapDuplicateRelativePaths() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/cli/js/sourceMapDuplicateRelativePaths.args");