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

Unified Diff: pkg/kernel/lib/binary/ast_from_binary.dart

Issue 2729913005: [Fasta] include source code in dill (Closed)
Patch Set: Addressed comments Created 3 years, 10 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
Index: pkg/kernel/lib/binary/ast_from_binary.dart
diff --git a/pkg/kernel/lib/binary/ast_from_binary.dart b/pkg/kernel/lib/binary/ast_from_binary.dart
index 949470651115955d5c1d2cc4301d7c00647dc06d..4ef84da608c5391b655691d198a9a66c39546fc6 100644
--- a/pkg/kernel/lib/binary/ast_from_binary.dart
+++ b/pkg/kernel/lib/binary/ast_from_binary.dart
@@ -74,6 +74,10 @@ class BinaryBuilder {
readByte();
}
+ List<int> readRawString() {
ahe 2017/03/03 13:14:50 Change name to readUtf8Bytes, readUint8List, or so
jensj 2017/03/06 07:38:36 Done.
+ return new List<int>.generate(readUInt(), (i) => readByte());
ahe 2017/03/03 13:14:51 How about: List<int> bytes = new Uint8List(readUI
jensj 2017/03/06 07:38:36 Done.
+ }
+
String readStringEntry() {
int numBytes = readUInt();
// Utf8Decoder will skip leading BOM characters, but we must preserve them.
@@ -271,7 +275,7 @@ class BinaryBuilder {
Map<String, Source> uriToSource = <String, Source>{};
for (int i = 0; i < length; ++i) {
String uri = _sourceUriTable[i];
- String sourceCode = readStringEntry();
+ List<int> sourceCode = readRawString();
int lineCount = readUInt();
List<int> lineStarts = new List<int>(lineCount);
int previousLineStart = 0;

Powered by Google App Engine
This is Rietveld 408576698