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

Unified Diff: tools/testing/dart/path.dart

Issue 2863253002: Tighten up a bunch of types in test.dart. (Closed)
Patch Set: Merge branch 'master' into types-for-test Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/testing/dart/package_testing_support.dart ('k') | tools/testing/dart/record_and_replay.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/path.dart
diff --git a/tools/testing/dart/path.dart b/tools/testing/dart/path.dart
index a3d35aac138660fed25fe937e821981ed5ed9498..99da4397e442238be1e8e98da14b5dd5e4203fee 100644
--- a/tools/testing/dart/path.dart
+++ b/tools/testing/dart/path.dart
@@ -174,7 +174,7 @@ class Path {
// All '..' segments of a relative path are at the beginning.
if (isEmpty) return false; // The canonical form of '' is '.'.
if (_path == '.') return true;
- List segs = _path.split('/'); // Don't mask the getter 'segments'.
+ var segs = _path.split('/'); // Don't mask the getter 'segments'.
if (segs[0] == '') {
// Absolute path
segs[0] = null; // Faster than removeRange().
@@ -190,15 +190,15 @@ class Path {
}
Path makeCanonical() {
- bool isAbs = isAbsolute;
- List segs = segments();
+ var isAbs = isAbsolute;
+ var segs = segments();
String drive;
if (isAbs && !segs.isEmpty && segs[0].length == 2 && segs[0][1] == ':') {
drive = segs[0];
segs.removeRange(0, 1);
}
- List newSegs = [];
- for (String segment in segs) {
+ var newSegs = <String>[];
+ for (var segment in segs) {
switch (segment) {
case '..':
// Absolute paths drop leading .. markers, including after a drive.
@@ -224,7 +224,7 @@ class Path {
}
}
- List segmentsToJoin = [];
+ var segmentsToJoin = <String>[];
if (isAbs) {
segmentsToJoin.add('');
if (drive != null) {
@@ -267,7 +267,7 @@ class Path {
}
List<String> segments() {
- List result = _path.split('/');
+ var result = _path.split('/');
if (isAbsolute) result.removeRange(0, 1);
if (hasTrailingSeparator) result.removeLast();
return result;
« no previous file with comments | « tools/testing/dart/package_testing_support.dart ('k') | tools/testing/dart/record_and_replay.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698