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"; |
} |