OLD | NEW |
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 @patch | 5 @patch |
6 class Error { | 6 class Error { |
7 @patch | 7 @patch |
8 static String _objectToString(Object object) { | 8 static String _objectToString(Object object) { |
9 return Object._toString(object); | 9 return Object._toString(object); |
10 } | 10 } |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 } | 48 } |
49 | 49 |
50 String get _messageString { | 50 String get _messageString { |
51 if (message == null) return "is not true."; | 51 if (message == null) return "is not true."; |
52 if (message is String) return message; | 52 if (message is String) return message; |
53 return Error.safeToString(message); | 53 return Error.safeToString(message); |
54 } | 54 } |
55 | 55 |
56 String toString() { | 56 String toString() { |
57 if (_url == null) { | 57 if (_url == null) { |
58 if (message == null) return _failedAssertion; | 58 if (message == null) return _failedAssertion?.trim(); |
59 return "'$_failedAssertion': $_messageString"; | 59 return "'${_failedAssertion?.trim()}': $_messageString"; |
60 } | 60 } |
61 var columnInfo = ""; | 61 var columnInfo = ""; |
62 if (_column > 0) { | 62 if (_column > 0) { |
63 // Only add column information if it is valid. | 63 // Only add column information if it is valid. |
64 columnInfo = " pos $_column"; | 64 columnInfo = " pos $_column"; |
65 } | 65 } |
66 return "'$_url': Failed assertion: line $_line$columnInfo: " | 66 return "'$_url': Failed assertion: line $_line$columnInfo: " |
67 "'$_failedAssertion': $_messageString"; | 67 "'$_failedAssertion': $_messageString"; |
68 } | 68 } |
69 | 69 |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 _DuplicatedFieldInitializerError(this._name); | 429 _DuplicatedFieldInitializerError(this._name); |
430 | 430 |
431 toString() => "Error: field '$_name' is already initialized."; | 431 toString() => "Error: field '$_name' is already initialized."; |
432 } | 432 } |
433 | 433 |
434 @patch | 434 @patch |
435 class _ConstantExpressionError { | 435 class _ConstantExpressionError { |
436 @patch | 436 @patch |
437 _throw(error) => throw error; | 437 _throw(error) => throw error; |
438 } | 438 } |
OLD | NEW |