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

Unified Diff: sdk/lib/_internal/pub_generated/lib/src/barback/cycle_exception.dart

Issue 557563002: Store the async-await compiled pub code directly in the repo. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/pub_generated/lib/src/barback/cycle_exception.dart
diff --git a/sdk/lib/_internal/pub_generated/lib/src/barback/cycle_exception.dart b/sdk/lib/_internal/pub_generated/lib/src/barback/cycle_exception.dart
new file mode 100644
index 0000000000000000000000000000000000000000..b516cd7ea0912c33a996c9649080ec3ca2fbe3a8
--- /dev/null
+++ b/sdk/lib/_internal/pub_generated/lib/src/barback/cycle_exception.dart
@@ -0,0 +1,29 @@
+library pub.barback.cycle_exception;
+import '../exceptions.dart';
+class CycleException implements ApplicationException {
+ final String _step;
+ final CycleException _next;
+ List<String> get steps {
+ if (_step == null) return [];
+ var exception = this;
+ var steps = [];
+ while (exception != null) {
+ steps.add(exception._step);
+ exception = exception._next;
+ }
+ return steps;
+ }
+ String get message {
+ var steps = this.steps;
+ if (steps.isEmpty) return "Transformer cycle detected.";
+ return "Transformer cycle detected:\n" +
+ steps.map((step) => " $step").join("\n");
+ }
+ CycleException([this._step]) : _next = null;
+ CycleException._(this._step, this._next);
+ CycleException prependStep(String step) {
+ if (_step == null) return new CycleException(step);
+ return new CycleException._(step, this);
+ }
+ String toString() => message;
+}

Powered by Google App Engine
This is Rietveld 408576698