Index: pkg/scheduled_test/lib/src/task.dart |
diff --git a/pkg/scheduled_test/lib/src/task.dart b/pkg/scheduled_test/lib/src/task.dart |
index e77f531a678d8056200ed6bbee31ad03ba1866ea..2dfc127163953bc9f2a0a5f8da82271007f5d14d 100644 |
--- a/pkg/scheduled_test/lib/src/task.dart |
+++ b/pkg/scheduled_test/lib/src/task.dart |
@@ -27,10 +27,10 @@ class Task { |
/// The queue to which this [Task] belongs. |
final TaskQueue queue; |
- // TODO(nweiz): make this a read-only view when issue 8321 is fixed. |
/// Child tasks that have been spawned while running this task. This will be |
/// empty if this task is a nested task. |
- final children = new Queue<Task>(); |
+ List<Task> get children => new UnmodifiableListView(_children); |
+ final _children = new Queue<Task>(); |
/// A [FutureGroup] that will complete once all current child tasks are |
/// finished running. This will be null if no child tasks are currently |
@@ -110,7 +110,7 @@ class Task { |
/// finished. |
Future runChild(fn(), String description) { |
var task = new Task._child(fn, description, this); |
- children.add(task); |
+ _children.add(task); |
if (_childGroup == null || _childGroup.completed) { |
_childGroup = new FutureGroup(); |
} |