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

Unified Diff: pkg/compiler/lib/src/io/source_file.dart

Issue 989113007: Don't include the trailing \0 of input bytes, in the string representation of source files. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/io/source_file.dart
diff --git a/pkg/compiler/lib/src/io/source_file.dart b/pkg/compiler/lib/src/io/source_file.dart
index c8f79cd4c7ac198f3733fa2c068e98b24372c117..8e3c440295f24961b312946c006ea602fc154e16 100644
--- a/pkg/compiler/lib/src/io/source_file.dart
+++ b/pkg/compiler/lib/src/io/source_file.dart
@@ -176,7 +176,10 @@ class Utf8BytesSourceFile extends SourceFile {
Utf8BytesSourceFile(this.uri, this.content);
- String slowText() => UTF8.decode(content);
+ String slowText() {
+ // Don't include the last '0' used by the scanner.
+ return UTF8.decode(content.sublist(0, content.length - 1));
+ }
List<int> slowUtf8Bytes() => content;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698