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

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

Issue 10850034: Rename BadNumberFormatException -> FormatException. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase. Created 8 years, 4 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/pub.dart ('k') | utils/pub/version.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 /** 5 /**
6 * Generic utility functions. Stuff that should possibly be in core. 6 * Generic utility functions. Stuff that should possibly be in core.
7 */ 7 */
8 #library('utils'); 8 #library('utils');
9 9
10 #import('dart:crypto'); 10 #import('dart:crypto');
11 #import('dart:isolate'); 11 #import('dart:isolate');
12 12
13 /** Thrown by methods that parse text when the text isn't a valid. */
14 class FormatException implements Exception {
15 final String message;
16
17 FormatException(this.message);
18
19 String toString() => message;
20 }
21
22 /** A pair of values. */ 13 /** A pair of values. */
23 class Pair<E, F> { 14 class Pair<E, F> {
24 E first; 15 E first;
25 F last; 16 F last;
26 17
27 Pair(this.first, this.last); 18 Pair(this.first, this.last);
28 19
29 String toString() => '($first, $last)'; 20 String toString() => '($first, $last)';
30 21
31 bool operator==(other) { 22 bool operator==(other) {
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 CryptoUtils.bytesToHex(new SHA1().update(source.charCodes()).digest()); 112 CryptoUtils.bytesToHex(new SHA1().update(source.charCodes()).digest());
122 113
123 /** 114 /**
124 * Returns a [Future] that completes in [milliSeconds]. 115 * Returns a [Future] that completes in [milliSeconds].
125 */ 116 */
126 Future sleep(int milliSeconds) { 117 Future sleep(int milliSeconds) {
127 var completer = new Completer(); 118 var completer = new Completer();
128 new Timer(milliSeconds, completer.complete); 119 new Timer(milliSeconds, completer.complete);
129 return completer.future; 120 return completer.future;
130 } 121 }
OLDNEW
« no previous file with comments | « utils/pub/pub.dart ('k') | utils/pub/version.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698