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

Unified Diff: pkg/front_end/lib/src/fasta/testing/validating_instrumentation.dart

Issue 2843103002: A couple of tweaks in ValidatingInstrumentation. (Closed)
Patch Set: Created 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/testing/validating_instrumentation.dart
diff --git a/pkg/front_end/lib/src/fasta/testing/validating_instrumentation.dart b/pkg/front_end/lib/src/fasta/testing/validating_instrumentation.dart
index 4d2d759bdad306461e777d351f19df5f7700d5c8..19b86eb9a0fe1e9a1455357b87bdb6ec050fe8af 100644
--- a/pkg/front_end/lib/src/fasta/testing/validating_instrumentation.dart
+++ b/pkg/front_end/lib/src/fasta/testing/validating_instrumentation.dart
@@ -52,7 +52,7 @@ class ValidatingInstrumentation implements Instrumentation {
/// form suitable for printing to the console.
///
/// Should be called after [finish].
- get problemsAsString => _problems.join('\n');
+ String get problemsAsString => _problems.join('\n');
/// Checks whether the property/value pairs passed to [record] match the
/// expectations loaded by [loadExpectations].
@@ -77,8 +77,8 @@ class ValidatingInstrumentation implements Instrumentation {
Future<Null> fixSource(Uri uri) async {
var fixes = _fixes[uri];
if (fixes == null) return;
- var bytes =
- (await readBytesFromFile(uri, ensureZeroTermination: false)).toList();
+ File file = new File.fromUri(uri);
+ var bytes = await file.readAsBytes();
// Apply the fixes in reverse order so that offsets don't need to be
// adjusted after each fix.
fixes.sort((a, b) => b.offset.compareTo(a.offset));
@@ -86,7 +86,7 @@ class ValidatingInstrumentation implements Instrumentation {
bytes.replaceRange(
fix.offset, fix.offset + fix.length, UTF8.encode(fix.replacement));
}
- await new File.fromUri(uri).writeAsBytes(bytes);
+ await file.writeAsBytes(bytes);
}
/// Loads expectations from the source file located at [uri].
« 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