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

Unified Diff: utils/tests/pub/command_line_config.dart

Issue 12087008: Handle parsing the "version" file better. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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 | « utils/pub/sdk.dart ('k') | utils/tests/pub/pub_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/tests/pub/command_line_config.dart
diff --git a/utils/tests/pub/command_line_config.dart b/utils/tests/pub/command_line_config.dart
index 1d4f7bf6d6f108ce2b909b8db1664a825127c56a..790e91ec4f5875dc3a25a083366fd18dd47ecf64 100644
--- a/utils/tests/pub/command_line_config.dart
+++ b/utils/tests/pub/command_line_config.dart
@@ -6,6 +6,7 @@ library command_line_config;
import 'dart:io';
+import '../../../pkg/path/lib/path.dart' as path;
import '../../../pkg/unittest/lib/unittest.dart';
import '../../pub/utils.dart';
@@ -70,6 +71,8 @@ class CommandLineConfiguration extends Configuration {
void _printStackTrace(String stackTrace) {
if (stackTrace == null || stackTrace == '') return;
+ print('');
+
// Parse out each stack entry.
var stack = [];
for (var line in stackTrace.split('\n')) {
@@ -79,33 +82,6 @@ class CommandLineConfiguration extends Configuration {
if (stack.length == 0) return;
- // Find the common prefixes of the paths.
- var common = 0;
- while (true) {
- var matching = true;
- var c;
- for (var frame in stack) {
- if (frame.isCore) continue;
- if (c == null) c = frame.library[common];
-
- if (frame.library.length <= common || frame.library[common] != c) {
- matching = false;
- break;
- }
- }
-
- if (!matching) break;
- common++;
- }
-
- // Remove them.
- if (common > 0) {
- for (var frame in stack) {
- if (frame.isCore) continue;
- frame.library = frame.library.substring(common);
- }
- }
-
// Figure out the longest path so we know how much to pad.
int longest = stack.mappedBy((frame) => frame.location.length).max();
@@ -138,7 +114,7 @@ class CommandLineConfiguration extends Configuration {
class _StackFrame {
static final fileRegExp = new RegExp(
- r'#\d+\s+(.*) \((file:///.+):(\d+):(\d+)\)');
+ r'#\d+\s+(.*) \(file://(/.+):(\d+):(\d+)\)');
static final coreRegExp = new RegExp(r'#\d+\s+(.*) \((.+):(\d+):(\d+)\)');
/// If `true`, then this stack frame is for a library built into Dart and
@@ -172,7 +148,13 @@ class _StackFrame {
isCore = true;
}
+ var library = match[2];
+ if (!isCore) {
+ // Make the library path relative to the entrypoint.
+ library = path.relative(library);
+ }
+
var member = match[1].replaceAll("<anonymous closure>", _LAMBDA);
- return new _StackFrame._(isCore, match[2], match[3], match[4], member);
+ return new _StackFrame._(isCore, library, match[3], match[4], member);
}
}
« no previous file with comments | « utils/pub/sdk.dart ('k') | utils/tests/pub/pub_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698