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

Side by Side Diff: dart/frog/leg/lib/mockimpl.dart

Issue 9605009: Don't stringify unmatched groups and throw IllegalArgumentException for bad date strings. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Mention co19 issue number. Created 8 years, 9 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 | « no previous file | dart/frog/leg/lib/regexp_helper.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 // Mocks of classes and interfaces that Leg cannot read directly. 5 // Mocks of classes and interfaces that Leg cannot read directly.
6 6
7 // TODO(ahe): Remove this file. 7 // TODO(ahe): Remove this file.
8 8
9 class JSSyntaxRegExp implements RegExp { 9 class JSSyntaxRegExp implements RegExp {
10 final String pattern; 10 final String pattern;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 List<String> this._groups); 71 List<String> this._groups);
72 72
73 final String pattern; 73 final String pattern;
74 final String str; 74 final String str;
75 final int _start; 75 final int _start;
76 final int _end; 76 final int _end;
77 final List<String> _groups; 77 final List<String> _groups;
78 78
79 int start() => _start; 79 int start() => _start;
80 int end() => _end; 80 int end() => _end;
81 String group(int index) => stringify(_groups[index]); 81 String group(int index) => _groups[index];
82 String operator [](int index) => group(index); 82 String operator [](int index) => group(index);
83 int groupCount() => _groups.length - 1; 83 int groupCount() => _groups.length - 1;
84 84
85 List<String> groups(List<int> groups) { 85 List<String> groups(List<int> groups) {
86 List<String> out = []; 86 List<String> out = [];
87 for (int i in groups) { 87 for (int i in groups) {
88 out.add(group(i)); 88 out.add(group(i));
89 } 89 }
90 return out; 90 return out;
91 } 91 }
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 } 449 }
450 String twoDigitMinutes = 450 String twoDigitMinutes =
451 twoDigits(inMinutes.remainder(Duration.MINUTES_PER_HOUR)); 451 twoDigits(inMinutes.remainder(Duration.MINUTES_PER_HOUR));
452 String twoDigitSeconds = 452 String twoDigitSeconds =
453 twoDigits(inSeconds.remainder(Duration.SECONDS_PER_MINUTE)); 453 twoDigits(inSeconds.remainder(Duration.SECONDS_PER_MINUTE));
454 String threeDigitMs = 454 String threeDigitMs =
455 threeDigits(inMilliseconds.remainder(Duration.MILLISECONDS_PER_SECOND)); 455 threeDigits(inMilliseconds.remainder(Duration.MILLISECONDS_PER_SECOND));
456 return "${inHours}:${twoDigitMinutes}:${twoDigitSeconds}.${threeDigitMs}"; 456 return "${inHours}:${twoDigitMinutes}:${twoDigitSeconds}.${threeDigitMs}";
457 } 457 }
458 } 458 }
OLDNEW
« no previous file with comments | « no previous file | dart/frog/leg/lib/regexp_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698