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

Side by Side Diff: packages/string_scanner/lib/src/utils.dart

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years, 2 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 string_scanner.utils; 5 library string_scanner.utils;
6 6
7 /// Validates the arguments passed to [StringScanner.error]. 7 /// Validates the arguments passed to [StringScanner.error].
8 void validateErrorArgs(String string, Match match, int position, int length) { 8 void validateErrorArgs(String string, Match match, int position, int length) {
9 if (match != null && (position != null || length != null)) { 9 if (match != null && (position != null || length != null)) {
10 throw new ArgumentError("Can't pass both match and position/length."); 10 throw new ArgumentError("Can't pass both match and position/length.");
(...skipping 10 matching lines...) Expand all
21 21
22 if (length != null && length < 0) { 22 if (length != null && length < 0) {
23 throw new RangeError("length must be greater than or equal to 0."); 23 throw new RangeError("length must be greater than or equal to 0.");
24 } 24 }
25 25
26 if (position != null && length != null && position + length > string.length) { 26 if (position != null && length != null && position + length > string.length) {
27 throw new RangeError("position plus length must not go beyond the end of " 27 throw new RangeError("position plus length must not go beyond the end of "
28 "the string."); 28 "the string.");
29 } 29 }
30 } 30 }
OLDNEW
« no previous file with comments | « packages/string_scanner/lib/src/string_scanner.dart ('k') | packages/string_scanner/lib/string_scanner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698