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

Unified Diff: lib/src/utils.dart

Issue 1860843002: Get rid of some unnecessary logic in terseChain(). (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 4 years, 8 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 | « no previous file | pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/utils.dart
diff --git a/lib/src/utils.dart b/lib/src/utils.dart
index 629cac3cf7b0831560ed0aa79fbcc3db89876f98..c499ac07195fb6bee78335a34996ac3f8683fb90 100644
--- a/lib/src/utils.dart
+++ b/lib/src/utils.dart
@@ -163,27 +163,15 @@ final _colorCode = new RegExp('\u001b\\[[0-9;]+m');
/// Returns [str] without any color codes.
String withoutColors(String str) => str.replaceAll(_colorCode, '');
-/// A regular expression matching the path to a temporary file used to start an
-/// isolate.
-///
-/// These paths aren't relevant and are removed from stack traces.
-final _isolatePath =
- new RegExp(r"/test_[A-Za-z0-9]{6}/runInIsolate\.dart$");
-
/// Returns [stackTrace] converted to a [Chain] with all irrelevant frames
/// folded together.
///
/// If [verbose] is `true`, returns the chain for [stackTrace] unmodified.
Chain terseChain(StackTrace stackTrace, {bool verbose: false}) {
if (verbose) return new Chain.forTrace(stackTrace);
- return new Chain.forTrace(stackTrace).foldFrames((frame) {
- if (frame.package == 'test') return true;
- if (frame.package == 'stream_channel') return true;
-
- // Filter out frames from our isolate bootstrap as well.
- if (frame.uri.scheme != 'file') return false;
- return frame.uri.path.contains(_isolatePath);
- }, terse: true);
+ return new Chain.forTrace(stackTrace).foldFrames((frame) =>
+ frame.package == 'test' || frame.package == 'stream_channel',
+ terse: true);
}
/// Flattens nested [Iterable]s inside an [Iterable] into a single [List]
« no previous file with comments | « no previous file | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698