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

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

Issue 1307363005: Add optional message argument to assert statements in the VM. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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
« runtime/vm/parser.cc ('K') | « runtime/vm/parser.cc ('k') | no next file » | 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 /** 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
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 /** Message describing the assertion error. */
100 final Object message;
sra1 2015/09/02 18:00:27 1. Is the intention to also give TypeError a messa
Lasse Reichstein Nielsen 2015/09/03 07:42:04 No, but it's an inadvertent consequence of making
101 AssertionError([this.message]);
99 } 102 }
100 103
101 /** 104 /**
102 * Error thrown by the runtime system when a type assertion fails. 105 * Error thrown by the runtime system when a type assertion fails.
103 */ 106 */
104 class TypeError extends AssertionError { 107 class TypeError extends AssertionError {
105 } 108 }
106 109
107 /** 110 /**
108 * Error thrown by the runtime system when a cast operation fails. 111 * Error thrown by the runtime system when a cast operation fails.
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 * the first time it is read. If evaluating the initializer expression causes 565 * the first time it is read. If evaluating the initializer expression causes
563 * another read of the variable, this error is thrown. 566 * another read of the variable, this error is thrown.
564 */ 567 */
565 class CyclicInitializationError extends Error { 568 class CyclicInitializationError extends Error {
566 final String variableName; 569 final String variableName;
567 CyclicInitializationError([this.variableName]); 570 CyclicInitializationError([this.variableName]);
568 String toString() => variableName == null 571 String toString() => variableName == null
569 ? "Reading static variable during its initialization" 572 ? "Reading static variable during its initialization"
570 : "Reading static variable '$variableName' during its initialization"; 573 : "Reading static variable '$variableName' during its initialization";
571 } 574 }
OLDNEW
« runtime/vm/parser.cc ('K') | « runtime/vm/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698