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

Side by Side Diff: lib/source_map_stack_trace.dart

Issue 1110513005: Add compatibility for Dart 1.10-style name munging. (Closed) Base URL: git@github.com:dart-lang/source_map_stack_trace.git@master
Patch Set: . Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « CHANGELOG.md ('k') | pubspec.yaml » ('j') | pubspec.yaml » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library source_map_stack_trace; 5 library source_map_stack_trace;
6 6
7 import 'package:path/path.dart' as p; 7 import 'package:path/path.dart' as p;
8 import 'package:source_maps/source_maps.dart'; 8 import 'package:source_maps/source_maps.dart';
9 import 'package:stack_trace/stack_trace.dart'; 9 import 'package:stack_trace/stack_trace.dart';
10 10
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 // is. 94 // is.
95 (match) => ".<fn>" * match[1].length) 95 (match) => ".<fn>" * match[1].length)
96 // Get rid of explicitly-generated calls. 96 // Get rid of explicitly-generated calls.
97 .replaceAll(new RegExp(r"\.call$"), "") 97 .replaceAll(new RegExp(r"\.call$"), "")
98 // Get rid of the top-level method prefix. 98 // Get rid of the top-level method prefix.
99 .replaceAll(new RegExp(r"^dart\."), "") 99 .replaceAll(new RegExp(r"^dart\."), "")
100 // Get rid of library namespaces. 100 // Get rid of library namespaces.
101 .replaceAll(new RegExp(r"[a-zA-Z_0-9]+\$"), "") 101 .replaceAll(new RegExp(r"[a-zA-Z_0-9]+\$"), "")
102 // Get rid of the static method prefix. The class name also exists in the 102 // Get rid of the static method prefix. The class name also exists in the
103 // invocation, so we're not getting rid of any information. 103 // invocation, so we're not getting rid of any information.
104 .replaceAll(new RegExp(r"^[a-zA-Z_0-9]+.static."), "") 104 .replaceAll(new RegExp(r"^[a-zA-Z_0-9]+.(static|dart)."), "")
105 // Convert underscores after identifiers to dots. This runs the risk of 105 // Convert underscores after identifiers to dots. This runs the risk of
106 // incorrectly converting members that contain underscores, but those are 106 // incorrectly converting members that contain underscores, but those are
107 // contrary to the style guide anyway. 107 // contrary to the style guide anyway.
108 .replaceAllMapped(new RegExp(r"([a-zA-Z0-9]+)_"), 108 .replaceAllMapped(new RegExp(r"([a-zA-Z0-9]+)_"),
109 (match) => match[1] + "."); 109 (match) => match[1] + ".");
110 } 110 }
OLDNEW
« no previous file with comments | « CHANGELOG.md ('k') | pubspec.yaml » ('j') | pubspec.yaml » ('J')

Powered by Google App Engine
This is Rietveld 408576698