| Index: pkg/dev_compiler/lib/src/compiler/compiler.dart
|
| diff --git a/pkg/dev_compiler/lib/src/compiler/compiler.dart b/pkg/dev_compiler/lib/src/compiler/compiler.dart
|
| index 93389ab2f94fa20b4694ef25cfc671cf8c2f56ca..332ec6b43c99b90cff9dd71b5810eaf77509439a 100644
|
| --- a/pkg/dev_compiler/lib/src/compiler/compiler.dart
|
| +++ b/pkg/dev_compiler/lib/src/compiler/compiler.dart
|
| @@ -509,12 +509,18 @@ class JSModuleFile {
|
| }
|
|
|
| var text = printer.getText();
|
| - var rawSourceMap = options.inlineSourceMap ? JSON.encode(builtMap) : null;
|
| + var rawSourceMap = 'null';
|
| + if (options.inlineSourceMap) {
|
| + var bytes = UTF8.encode(JSON.encode(builtMap));
|
| + // Base64 encode instead of json escaping to work around V8 bug
|
| + // unescaping strings with a large number of slashes.
|
| + rawSourceMap = "'${BASE64.encode(bytes)}'";
|
| + }
|
| // Encode the sourcemap as an escaped string rather than JSON
|
| // as Dart code using the sourcemap can't take advantage of it being JS
|
| // JSON so we might as well encode it as a String which should be quicker
|
| // to parse.
|
| - text = text.replaceFirst(sourceMapHoleID, JSON.encode(rawSourceMap));
|
| + text = text.replaceFirst(sourceMapHoleID, rawSourceMap);
|
|
|
| return new JSModuleCode(text, builtMap);
|
| }
|
|
|