Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Unified Diff: pkg/dev_compiler/web/stack_trace_mapper.dart

Issue 2747733003: Do not return the JSON as an escaped String to work around a strange v8 bug. (Closed)
Patch Set: Do not return the JSON as an escaped String to work around a strange v8 bug. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/dev_compiler/lib/src/compiler/compiler.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/web/stack_trace_mapper.dart
diff --git a/pkg/dev_compiler/web/stack_trace_mapper.dart b/pkg/dev_compiler/web/stack_trace_mapper.dart
index e863fa7b44215574128f13627e61ea8d829ecb64..fda5b8b95afea870f36807793389edabeef00e4e 100644
--- a/pkg/dev_compiler/web/stack_trace_mapper.dart
+++ b/pkg/dev_compiler/web/stack_trace_mapper.dart
@@ -39,7 +39,7 @@ typedef void ReadyCallback();
external set dartStackTraceUtility(DartStackTraceUtility value);
typedef String StackTraceMapper(String stackTrace);
-typedef String SourceMapProvider(String modulePath);
+typedef dynamic SourceMapProvider(String modulePath);
typedef String SetSourceMapProvider(SourceMapProvider provider);
@JS()
@@ -49,6 +49,9 @@ class DartStackTraceUtility {
{StackTraceMapper mapper, SetSourceMapProvider setSourceMapProvider});
}
+@JS('JSON.stringify')
+external String _stringify(dynamic json);
+
/// Source mapping that is waits to parse source maps until they match the uri
/// of a requested source map.
///
@@ -72,6 +75,10 @@ class LazyMapping extends Mapping {
if (!_bundle.containsMapping(uri)) {
var rawMap = _provider(uri);
if (rawMap != null) {
+ if (rawMap is! String) {
+ // The sourcemap was passed as regular JavaScript JSON.
+ rawMap = _stringify(rawMap);
+ }
SingleMapping mapping = parse(rawMap);
mapping
..targetUrl = uri
« no previous file with comments | « pkg/dev_compiler/lib/src/compiler/compiler.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698