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

Unified Diff: sdk/lib/core/errors.dart

Issue 11415028: Remove NullPointerException. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed VM bugs. Created 8 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/core/errors.dart
diff --git a/sdk/lib/core/errors.dart b/sdk/lib/core/errors.dart
index dc03a4af289a503a9f51bd32a355573763c018f6..eeb0c04fdef2e4f25040354dc318709b320b4728 100644
--- a/sdk/lib/core/errors.dart
+++ b/sdk/lib/core/errors.dart
@@ -50,13 +50,21 @@ class CastError implements Error {
}
/**
+ * Error thrown when attempting to throw [:null:].
+ */
+class NullThrownError implements Error {
+ const NullThrownError();
+ String toString() => "Throw of null.";
+}
+
+/**
* Error thrown when a function is passed an unacceptable argument.
*/
class ArgumentError implements Error {
final message;
/** The [message] describes the erroneous argument. */
- const ArgumentError([this.message]);
+ ArgumentError([this.message]);
String toString() {
if (message != null) {

Powered by Google App Engine
This is Rietveld 408576698