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

Side by Side Diff: utils/tests/pub/command_line_config.dart

Issue 14253005: Migrate pub away from throwing strings. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « utils/pub/utils.dart ('k') | utils/tests/pub/descriptor/tar.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 command_line_config; 5 library command_line_config;
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 import 'dart:math' as math; 8 import 'dart:math' as math;
9 9
10 import 'package:pathos/path.dart' as path; 10 import 'package:pathos/path.dart' as path;
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 String get location => '$library $line:$column'; 146 String get location => '$library $line:$column';
147 147
148 _StackFrame._(this.isCore, this.library, this.line, this.column, this.member); 148 _StackFrame._(this.isCore, this.library, this.line, this.column, this.member);
149 149
150 factory _StackFrame(String text) { 150 factory _StackFrame(String text) {
151 var match = fileRegExp.firstMatch(text); 151 var match = fileRegExp.firstMatch(text);
152 var isCore = false; 152 var isCore = false;
153 153
154 if (match == null) { 154 if (match == null) {
155 match = coreRegExp.firstMatch(text); 155 match = coreRegExp.firstMatch(text);
156 if (match == null) throw "Couldn't parse stack trace line '$text'."; 156 if (match == null) {
157 throw FormatException("Couldn't parse stack trace line '$text'.");
158 }
157 isCore = true; 159 isCore = true;
158 } 160 }
159 161
160 var library = match[2]; 162 var library = match[2];
161 if (!isCore) { 163 if (!isCore) {
162 // Make the library path relative to the entrypoint. 164 // Make the library path relative to the entrypoint.
163 library = path.relative(library); 165 library = path.relative(library);
164 } 166 }
165 167
166 var member = match[1].replaceAll("<anonymous closure>", _lambda); 168 var member = match[1].replaceAll("<anonymous closure>", _lambda);
167 return new _StackFrame._(isCore, library, match[3], match[4], member); 169 return new _StackFrame._(isCore, library, match[3], match[4], member);
168 } 170 }
169 } 171 }
OLDNEW
« no previous file with comments | « utils/pub/utils.dart ('k') | utils/tests/pub/descriptor/tar.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698