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

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

Issue 16154017: Rename RuntimeError to CyclicIntializationError, as per spec. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix bad merge in js_helper.dart Created 7 years, 6 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 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 34fcaeddf29cbe0c41346e4ee8d248a1e7d598a3..060eba7c5a82d39a742a65b07a8f4896ab5ea331 100644
--- a/sdk/lib/core/errors.dart
+++ b/sdk/lib/core/errors.dart
@@ -229,16 +229,23 @@ class OutOfMemoryError implements Error {
String toString() => "Out of Memory";
}
+
class StackOverflowError implements Error {
const StackOverflowError();
String toString() => "Stack Overflow";
}
/**
- * Error thrown when a runtime error occurs.
+ * Error thrown when a lazily initialized variable cannot be initialized.
+ *
+ * A static/library variable with an initializer expression is initialized
+ * the first time it is read. If evaluating the initializer expression causes
+ * another read of the variable, this error is thrown.
*/
-class RuntimeError implements Error {
- final message;
- RuntimeError(this.message);
- String toString() => "RuntimeError: $message";
+class CyclicInitializationError implements Error {
+ final String variableName;
+ const CyclicInitializationError([this.variableName]);
+ String toString() => variableName == null
+ ? "Reading static variable during its initialization"
+ : "Reading static variable '$variableName' during its initialization";
}

Powered by Google App Engine
This is Rietveld 408576698