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

Unified Diff: packages/source_span/lib/src/span_exception.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 5 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 | « packages/source_span/lib/src/span.dart ('k') | packages/source_span/lib/src/span_mixin.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/source_span/lib/src/span_exception.dart
diff --git a/packages/source_span/lib/src/span_exception.dart b/packages/source_span/lib/src/span_exception.dart
index 36f2488329d1331589ab9dc3f1635e7ba81a7cd4..6d3448b6c4f25082882849c76b5b146a943f6d9e 100644
--- a/packages/source_span/lib/src/span_exception.dart
+++ b/packages/source_span/lib/src/span_exception.dart
@@ -2,21 +2,23 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-library source_span.span_exception;
-
import 'span.dart';
/// A class for exceptions that have source span information attached.
class SourceSpanException implements Exception {
+ // This is a getter so that subclasses can override it.
/// A message describing the exception.
- final String message;
+ String get message => _message;
+ final String _message;
+ // This is a getter so that subclasses can override it.
/// The span associated with this exception.
///
/// This may be `null` if the source location can't be determined.
- final SourceSpan span;
+ SourceSpan get span => _span;
+ final SourceSpan _span;
- SourceSpanException(this.message, this.span);
+ SourceSpanException(this._message, this._span);
/// Returns a string representation of [this].
///
@@ -34,10 +36,12 @@ class SourceSpanException implements Exception {
/// A [SourceSpanException] that's also a [FormatException].
class SourceSpanFormatException extends SourceSpanException
implements FormatException {
- final source;
+ // This is a getter so that subclasses can override it.
+ dynamic get source => _source;
+ final _source;
int get offset => span == null ? null : span.start.offset;
- SourceSpanFormatException(String message, SourceSpan span, [this.source])
+ SourceSpanFormatException(String message, SourceSpan span, [this._source])
: super(message, span);
}
« no previous file with comments | « packages/source_span/lib/src/span.dart ('k') | packages/source_span/lib/src/span_mixin.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698