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

Side by Side Diff: dart/sdk/lib/core/errors.dart

Issue 56933002: Version 0.8.10.1 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 1 month 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 | « dart/sdk/lib/async/future_impl.dart ('k') | dart/sdk/lib/html/dart2js/html_dart2js.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 part of dart.core; 5 part of dart.core;
6 6
7 class Error { 7 class Error {
8 /** 8 /**
9 * Safely convert a value to a [String] description. 9 * Safely convert a value to a [String] description.
10 * 10 *
11 * The conversion is guaranteed to not throw, so it won't use the object's 11 * The conversion is guaranteed to not throw, so it won't use the object's
12 * toString method. 12 * toString method.
13 */ 13 */
14 static String safeToString(Object object) { 14 static String safeToString(Object object) {
15 if (object is int || object is double || object is bool || null == object) { 15 if (object is num || object is bool || null == object) {
16 return object.toString(); 16 return object.toString();
17 } 17 }
18 if (object is String) { 18 if (object is String) {
19 String string = object; 19 String string = object;
20 StringBuffer buffer = new StringBuffer('"'); 20 StringBuffer buffer = new StringBuffer('"');
21 const int TAB = 0x09; 21 const int TAB = 0x09;
22 const int NEWLINE = 0x0a; 22 const int NEWLINE = 0x0a;
23 const int CARRIGE_RETURN = 0x0d; 23 const int CARRIGE_RETURN = 0x0d;
24 const int BACKSLASH = 0x5c; 24 const int BACKSLASH = 0x5c;
25 const int DOUBLE_QUOTE = 0x22; 25 const int DOUBLE_QUOTE = 0x22;
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 * the first time it is read. If evaluating the initializer expression causes 293 * the first time it is read. If evaluating the initializer expression causes
294 * another read of the variable, this error is thrown. 294 * another read of the variable, this error is thrown.
295 */ 295 */
296 class CyclicInitializationError extends Error { 296 class CyclicInitializationError extends Error {
297 final String variableName; 297 final String variableName;
298 CyclicInitializationError([this.variableName]); 298 CyclicInitializationError([this.variableName]);
299 String toString() => variableName == null 299 String toString() => variableName == null
300 ? "Reading static variable during its initialization" 300 ? "Reading static variable during its initialization"
301 : "Reading static variable '$variableName' during its initialization"; 301 : "Reading static variable '$variableName' during its initialization";
302 } 302 }
OLDNEW
« no previous file with comments | « dart/sdk/lib/async/future_impl.dart ('k') | dart/sdk/lib/html/dart2js/html_dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698