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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
89 | 89 |
90 external static String _objectToString(Object object); | 90 external static String _objectToString(Object object); |
91 | 91 |
92 external StackTrace get stackTrace; | 92 external StackTrace get stackTrace; |
93 } | 93 } |
94 | 94 |
95 /** | 95 /** |
96 * Error thrown by the runtime system when an assert statement fails. | 96 * Error thrown by the runtime system when an assert statement fails. |
97 */ | 97 */ |
98 class AssertionError extends Error { | 98 class AssertionError extends Error { |
99 AssertionError(); | 99 /** Message describing the assertion error. */ |
Lasse Reichstein Nielsen
2016/11/24 15:13:36
Still not absolutely sure this should be public.
I
| |
100 final Object message; | |
101 AssertionError([this.message]); | |
100 String toString() => "Assertion failed"; | 102 String toString() => "Assertion failed"; |
101 } | 103 } |
102 | 104 |
103 /** | 105 /** |
104 * Error thrown by the runtime system when a type assertion fails. | 106 * Error thrown by the runtime system when a type assertion fails. |
105 */ | 107 */ |
106 class TypeError extends AssertionError { | 108 class TypeError extends AssertionError { |
107 } | 109 } |
108 | 110 |
109 /** | 111 /** |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
564 * the first time it is read. If evaluating the initializer expression causes | 566 * the first time it is read. If evaluating the initializer expression causes |
565 * another read of the variable, this error is thrown. | 567 * another read of the variable, this error is thrown. |
566 */ | 568 */ |
567 class CyclicInitializationError extends Error { | 569 class CyclicInitializationError extends Error { |
568 final String variableName; | 570 final String variableName; |
569 CyclicInitializationError([this.variableName]); | 571 CyclicInitializationError([this.variableName]); |
570 String toString() => variableName == null | 572 String toString() => variableName == null |
571 ? "Reading static variable during its initialization" | 573 ? "Reading static variable during its initialization" |
572 : "Reading static variable '$variableName' during its initialization"; | 574 : "Reading static variable '$variableName' during its initialization"; |
573 } | 575 } |
OLD | NEW |