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

Unified Diff: packages/source_span/lib/src/file.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/colors.dart ('k') | packages/source_span/lib/src/location.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/source_span/lib/src/file.dart
diff --git a/packages/source_span/lib/src/file.dart b/packages/source_span/lib/src/file.dart
index 37790ce9296b8d8a31104373a422e36e22841aa9..0217c2d43aaaea3b79df87cfbbc14d7f3d11ac79 100644
--- a/packages/source_span/lib/src/file.dart
+++ b/packages/source_span/lib/src/file.dart
@@ -2,8 +2,6 @@
// 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.file;
-
import 'dart:math' as math;
import 'dart:typed_data';
@@ -51,15 +49,28 @@ class SourceFile {
/// previous result.
int _cachedLine;
- /// Creates a new source file from [text].
+ /// This constructor is deprecated.
///
- /// [url] may be either a [String], a [Uri], or `null`.
+ /// Use [new SourceFile.fromString] instead.
+ @Deprecated("Will be removed in 2.0.0")
SourceFile(String text, {url})
: this.decoded(text.runes, url: url);
- /// Creates a new source file from a list of decoded characters.
+ /// Creates a new source file from [text].
+ ///
+ /// [url] may be either a [String], a [Uri], or `null`.
+ SourceFile.fromString(String text, {url})
+ : this.decoded(text.codeUnits, url: url);
+
+ /// Creates a new source file from a list of decoded code units.
///
/// [url] may be either a [String], a [Uri], or `null`.
+ ///
+ /// Currently, if [decodedChars] contains characters larger than `0xFFFF`,
+ /// they'll be treated as single characters rather than being split into
+ /// surrogate pairs. **This behavior is deprecated**. For
+ /// forwards-compatibility, callers should only pass in characters less than
+ /// or equal to `0xFFFF`.
SourceFile.decoded(Iterable<int> decodedChars, {url})
: url = url is String ? Uri.parse(url) : url,
_decodedChars = new Uint32List.fromList(decodedChars.toList()) {
« no previous file with comments | « packages/source_span/lib/src/colors.dart ('k') | packages/source_span/lib/src/location.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698