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

Unified Diff: pkg/stack_trace/lib/src/trace.dart

Issue 14394003: Use UnmodifiableListView to expose read-only lists. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review change. Created 7 years, 8 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
« no previous file with comments | « pkg/scheduled_test/lib/src/task.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/stack_trace/lib/src/trace.dart
diff --git a/pkg/stack_trace/lib/src/trace.dart b/pkg/stack_trace/lib/src/trace.dart
index fa0c313c662d03e8063a852e028956b8d5c9a7e8..54f99db57bb39082cde1943fd65653d5fe74e954 100644
--- a/pkg/stack_trace/lib/src/trace.dart
+++ b/pkg/stack_trace/lib/src/trace.dart
@@ -4,6 +4,7 @@
library trace;
+import 'dart:collection';
import 'dart:uri';
import 'dart:math' as math;
@@ -13,7 +14,6 @@ final _patchRegExp = new RegExp(r"-patch$");
/// A stack trace, comprised of a list of stack frames.
class Trace implements StackTrace {
- // TODO(nweiz): make this read-only once issue 8321 is fixed.
/// The stack frames that comprise this stack trace.
final List<Frame> frames;
@@ -63,7 +63,7 @@ class Trace implements StackTrace {
/// Returns a new [Trace] comprised of [frames].
Trace(Iterable<Frame> frames)
- : frames = frames.toList();
+ : frames = new UnmodifiableListView<Frame>(frames.toList());
// TODO(nweiz): Keep track of which [Frame]s are part of the partial stack
// trace and only print them.
« no previous file with comments | « pkg/scheduled_test/lib/src/task.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698