Chromium Code Reviews| 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 part of dart.core; | 5 part of dart.core; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Error objects thrown in the case of a program failure. | 8 * Error objects thrown in the case of a program failure. |
| 9 * | 9 * |
| 10 * An `Error` object represents a program failure that the programmer | 10 * An `Error` object represents a program failure that the programmer |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 113 } | 113 } |
| 114 | 114 |
| 115 /** | 115 /** |
| 116 * Error thrown when attempting to throw [:null:]. | 116 * Error thrown when attempting to throw [:null:]. |
| 117 */ | 117 */ |
| 118 class NullThrownError extends Error { | 118 class NullThrownError extends Error { |
| 119 String toString() => "Throw of null."; | 119 String toString() => "Throw of null."; |
| 120 } | 120 } |
| 121 | 121 |
| 122 /** | 122 /** |
| 123 * Error thrown when attempting to dereference [:null:]. | |
| 124 */ | |
| 125 class NullDereferenceError extends Error implements NoSuchMethodError { | |
| 126 /** Message describing the problem. */ | |
| 127 final message; | |
| 128 | |
| 129 /** | |
| 130 * The [message] optionally describes the circumstances under which [:null:] w as dereferenced. | |
|
Cutch
2016/10/07 23:24:11
80 columns...
| |
| 131 */ | |
| 132 NullDereferenceError([this.message]); | |
| 133 | |
| 134 String toString() => "Cannot dereference null.${ message != null ? ' $message' : ''}"; | |
| 135 } | |
| 136 | |
| 137 /** | |
| 123 * Error thrown when a function is passed an unacceptable argument. | 138 * Error thrown when a function is passed an unacceptable argument. |
| 124 */ | 139 */ |
| 125 class ArgumentError extends Error { | 140 class ArgumentError extends Error { |
| 126 /** Whether value was provided. */ | 141 /** Whether value was provided. */ |
| 127 final bool _hasValue; | 142 final bool _hasValue; |
| 128 /** The invalid value. */ | 143 /** The invalid value. */ |
| 129 final invalidValue; | 144 final invalidValue; |
| 130 /** Name of the invalid argument, if available. */ | 145 /** Name of the invalid argument, if available. */ |
| 131 final String name; | 146 final String name; |
| 132 /** Message describing the problem. */ | 147 /** Message describing the problem. */ |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 564 * the first time it is read. If evaluating the initializer expression causes | 579 * the first time it is read. If evaluating the initializer expression causes |
| 565 * another read of the variable, this error is thrown. | 580 * another read of the variable, this error is thrown. |
| 566 */ | 581 */ |
| 567 class CyclicInitializationError extends Error { | 582 class CyclicInitializationError extends Error { |
| 568 final String variableName; | 583 final String variableName; |
| 569 CyclicInitializationError([this.variableName]); | 584 CyclicInitializationError([this.variableName]); |
| 570 String toString() => variableName == null | 585 String toString() => variableName == null |
| 571 ? "Reading static variable during its initialization" | 586 ? "Reading static variable during its initialization" |
| 572 : "Reading static variable '$variableName' during its initialization"; | 587 : "Reading static variable '$variableName' during its initialization"; |
| 573 } | 588 } |
| OLD | NEW |